New Ways to Get Toastr
The Toastr demo page is also updated to show off some of the new features, most notably the animations and close button.
Note: CDNJS may be up to a few days before it is available there.
Animation Changes (Breaking)
The following animations options have been deprecated and should be replaced:
Animation Options (New)
Toastr will supply default animations, so you do not have to provide any of these settings. However you have the option to override the animations if you like.
Optionally override the animation easing to show or hide the toasts. Default is swing. swing and linear are built into jQuery.
toastr.options.showEasing = 'swing'; toastr.options.hideEasing = 'linear';
Using the jQuery Easing plugin (http://www.gsgd.co.uk/sandbox/jquery/easing/)
toastr.options.showEasing = 'easeOutBounce'; toastr.options.hideEasing = 'easeInBack';
Use the jQuery show/hide method of your choice. These default to fadeIn/fadeOut. The methods fadeIn/fadeOut, slideDown/slideUp, and show/hide are built into jQuery.
toastr.options.showMethod = 'slideDown'; toastr.options.hideMethod = 'slideUp';
Close Button (New)
Optionally enable a close button
toastr.options.closeButton = true;
Optionally override the close button’s HTML.
toastr.options.closeHtml = '';
You can also override the CSS/LESS for
Display Sequence (New)
Show newest toast at bottom (top is default)
toastr.options.newestOnTop = false;
Thanks to the folks who contributed issues or pull requests to this release including: Ryan Hoffman, Jon Gallant, Jon Fazzaro, Craig Teegarden, Umberto, Raffi, Cesar Vargas, and Prashanfdo. (Sorry for any names I got wrong, I used the github user IDs).