GithubHelp home page GithubHelp logo

hitoast's Introduction

HiToast.js

Summary

HiToast.js is a simple notification library similar to Toast designed to be used in mobile apps .

Hitoast.js is based on the development of jQuery or Zepto .

Installation

Dependency: jQuery or Zepto.

Download HiToast.js:

  • from GitHub

  • with Npm :

    npm install hitoast.js

Add a div.hitoast which will contain the alerts :

<div id="hitoast"></div>

Usage

To call a notification, use hiToast(text, options). Examples :

hiToast("Successfully Create Your Account",{thems:'Success',position:'top'});
hiToast("Hi Toast! You are so handsome",{thems:'Info',position:'center',duration: 5000});
hiToast("Please Check Your Code",{thems:'Waring',fade-time:'fast'});
hiToast("Sorry, bug is coming.",{thems:'Error',position:'bottom','duration': 3000});

To remove a notification, use hiToastX().

Toast are automatically bound to a click event and hiToastX() is called when the toast is clicked.

Styling:

Before using , please add the following styles to your CSS file :

.toast {	
	padding: 5px 15px;
	border: 1px solid #eed3d7;
	border-radius: 4px;
	position: fixed;height: 20px;
}
.toast-Error {
	color: white;
	background-color: #DA4453;
}
.toast-Success {
	color: white;
	background-color: #37BC9B;
}
.toast-Info {
	color: white;
	background-color: #4A89DC;
}
.toast-Waring {
	color: white;
	background-color: #F6BB42;
}

##Demo

You can see a demo here.

Contribution

If you have good comments or suggestions, please give me a issue or pull request.

hitoast's People

Contributors

hicoldcat avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

hyzcq zhoucuole

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.