dead-toast

Dead simple Javascript Toast like Android.


Keywords
toast, js, javascript, frontend, android
License
MIT
Install
bower install dead-toast#1.0.0

Documentation

logo


dead-toast

🍞 Dead simple Javascript Toast like Android.
No dependences and tiny
Created by Lee Sun-Hyoup.

Demo

Here

Installation

CDN

<script src="https://unpkg.com/dead-toast@1"></script>

Bower

bower install dead-toast

Node.js

npm install dead-toast

Or just download dead-toast.min.js and dead-toast.min.css, use it locally:

<link rel="stylesheet" type="text/css" href="dead-toast.min.css">
<script src="dead-toast.min.js"></script>

Usage

Very simple usage:

DeadToast.makeText('Hello, World!').show();

If you want to avoid DeadToast accumulation, see the below.

var duration = 2000;
var toast = DeadToast.makeText('message', duration);

$('button').click(function() { // jQuery
  toast.show();
});

You can cancel the DeadToast showing.

var duration = 2000;
var toast = DeadToast.makeText('message', duration);

$('button').click(function() { // jQuery
  toast.cancel();
  // If you want to hide Toast immediately, you should to first parameter set true.
  // ex) toast.cancel(true);
});

License

MIT License

Copyright (c) 2016 Lee Sun-Hyoup

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.