TOASTR Customization Tips

Source: Internet
Author: User
Tags toastr

Online example

Example Demo

How to use
    1. <button Type="button" class="btn btn-primary" id="Showtoast "> display </button>
Copy
    1. Toastr. Info(' I'm just a hint message ')
CopyParameter description
  1. $(function() {
  2. ///parameter settings, if the default value can be omitted to the following generation
  3. Toastr. Options = {
  4. "CloseButton": false, //Whether the Close button is displayed
  5. "Debug": false, //whether to use Debug mode
  6. "Positionclass": location of "Toast-top-full-width",//pop-up window
  7. "Showduration": "+",//animation time displayed
  8. "Hideduration": "+",//Lost animation time
  9. "TimeOut": "The", //Show time
  10. " extendedtimeout": "+",//Extended display time
  11. "Showeasing": "Swing",//animation buffering mode at display
  12. "Hideeasing": "linear",//animation buffering mode when disappearing
  13. "Showmethod": "FadeIn",//Animation mode on display
  14. "Hidemethod": animation mode when "FadeOut"//Disappears
  15. };
  16. //Successful prompt binding
  17. $("#success"). Click(function() {
  18. Toastr. Success("Congratulations on your Success");
  19. })
  20. //Information hint binding
  21. $("#info"). Click(function() {
  22. Toastr. Info("This is a hint message");
  23. })
  24. //WARNING hint binding
  25. $("#warning"). Click(function() {
  26. Toastr. Warning("warn you not to bother me");
  27. })
  28. //Wrong language hint binding
  29. $("#error"). Click(function() {
  30. Toastr. Error("errors, please change");
  31. })
  32. //Clear window bindings
  33. $("#clear"). Click(function() {
  34. Toastr. Clear();
  35. })
  36. })
Copy

Download

TOASTR Customization Tips

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.