How To Add toast.js?

As Nice, as it looks for notification easier it gets if you are familiar with
JavaScript and have some experience in HTML.

Firstly, we need to add the ‘.js’ and ‘.css’ file which are available on github link

Second, you need to define the event to perform toast. You can use this notification on events like onClick, onSubmit etc. or on ajax response.

Syntex :- tostr.success(‘Your Message‘);

toastr.success('Success messages'); //For Success Message
toastr.error('errors messages'); //For Error
toastr.warning('warning messages'); //For Warning
toastr.info('info messages'); //For Info

You Can Also Define Other Attribute of toast.js

toastr.options = {"closeButton": false,
   "debug": false,
   "positionClass": "toast-bottom-right",// Position on window
   "onclick": null,// on click function
   "showDuration": "300",
   "hideDuration": "1000",
   "timeOut": "5000",
   "extendedTimeOut": "1000",
   "showEasing": "swing",
   "hideEasing": "linear",
   "showMethod": "fadeIn",
   "hideMethod": "fadeOut"
 };

Leave a Reply

Your email address will not be published. Required fields are marked *