toastr 自訂提示

來源:互聯網
上載者:User

標籤:extend   btn   提示資訊   show   cli   ati   展現   hid   href   

線上執行個體

執行個體示範

使用方法
  1. <button type="button" class="btn btn-primary" id="showtoast">顯示</button>
複製
  1. toastr.info(‘我只是一個提示資訊‘)
複製參數說明
  1. $(function(){
  2.     //參數設定,若用預設值可以省略以下面代
  3.     toastr.options = {
  4. "closeButton": false, //是否顯示關閉按鈕
  5. "debug": false, //是否使用debug模式
  6. "positionClass": "toast-top-full-width",//彈出窗的位置
  7. "showDuration": "300",//顯示的動畫時間
  8. "hideDuration": "1000",//消失的動畫時間
  9. "timeOut": "5000", //展現時間
  10. "extendedTimeOut": "1000",//加長展示時間
  11. "showEasing": "swing",//顯示時的動畫緩衝方式
  12. "hideEasing": "linear",//消失時的動畫緩衝方式
  13. "showMethod": "fadeIn",//顯示時的動畫方式
  14. "hideMethod": "fadeOut" //消失時的動畫方式
  15. };
  16.  
  17. //成功提示綁定
  18. $("#success").click(function(){
  19. toastr.success("祝賀你成功了");
  20. })
  21. //資訊提示綁定
  22. $("#info").click(function(){
  23. toastr.info("這是一個提示資訊");
  24. })
  25. //敬告提示綁定
  26. $("#warning").click(function(){
  27. toastr.warning("警告你別來煩我了");
  28. })
  29. //錯語提示綁定
  30. $("#error").click(function(){
  31. toastr.error("出現錯誤,請更改");
  32. })
  33. //清除視窗綁定
  34. $("#clear").click(function(){
  35. toastr.clear();
  36. })
  37. })
複製

 

下載

 

toastr 自訂提示

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.