Tiny Android Toast Message Plugin - jQuery Toastx

Tiny Android Toast Message Plugin - jQuery Toastx
File Size: 3.78 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Toastx is an ultra-light jQuery toaster plugin to show Android-style toast messages that auto dismiss after a certain timeout with a smooth fade animation.

See Also:

How to use it:

1. To use this plugin, include the JavaScript jquery.toastx.js after loading jQuery JavaScript library.

<script src="/path/to/jquery.min.js"></script>
<script src="/path/to/jquery.toastx.js"></script>

2. The JavaScript to show a toast message on the screen.

$(function(){
  $.toastx('Toast Message Here');
});

// or
$.toast({
  'message': 'Toast Message Here'
}).show();

3. HTML content is supported as well.

$.toast({'message': '<i class="far fa-bell"></i> Toast Message Here'}).show();

4. Determine the container the toast message should append to. Default: 'body'.

$.toast({
  'message': 'Toast Message Here',
  'appendToCtxSel': '#myContainer'
}).show();

5. Set the time to wait before dismissing the toast message. Default: 4000ms.

$.toast({
  'message':'Toast Message Here',
  'durationTime': 5000
}).show();

6. Set the top & left position of the toast message.

$.toast({
  'message': 'Toast Message Here',
  'left': null,
  'top': null
}).show();

This awesome jQuery plugin is developed by ciyuanchild. For more Advanced Usages, please check the demo page or visit the official website.