module
and require
from the .jshintrc
filebuilds
foldergulp
calltoastr.options.preventDuplicates = true;
toastr.options.progressBar = true;
Optionally enable a close button
toastr.options.closeButton = true;
Optionally override the close button's HTML.
toastr.options.closeHtml = '<button><i class="icon-off"></i></button>';
You can also override the CSS/LESS for #toast-container .toast-close-button
// Define a callback for when the toast is shown/hidden
toastr.options.onShown = function() { console.log('hello'); }
toastr.options.onHidden = function() { console.log('goodbye'); }
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.
####Easings 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';
####Animation Method 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';
###Timeouts Control how toastr interacts with users by setting timeouts appropriately.
toastr.options.timeout = 30; // How long the toast will display without user interaction
toastr.options.extendedTimeOut = 60; // How long the toast will display after a user hovers over it
###Animation Changes The following animations options have been deprecated and should be replaced:
options.fadeIn
with options.showDuration
options.onFadeIn
with options.onShown
options.fadeOut
with options.hideDuration
options.onFadeOut
with options.onHidden
Show newest toast at bottom (top is default)
toastr.options.newestOnTop = false;