菜单切换
FACESOHO知行者
心灵
记录
远方
赞赏工具
源代码:
点击运行
保存
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <!--[if gte IE 9]><!--> <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script> <!--<![endif]--> <!--[if lt IE 9]> <script src="//cdn.staticfile.org/jquery/1.9.1/jquery.min.js"></script> <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script> <![endif]--> <link href="https://cdn.bootcss.com/toastr.js/2.1.4/toastr.min.css" rel="stylesheet"> <script src="https://cdn.bootcss.com/toastr.js/2.1.4/toastr.min.js"></script> </head> <body> <div data-role="page" id="pageone"> <script> toastr.options = { closeButton: false, debug: false, progressBar: true, positionClass: "toast-top-center", onclick: null, showDuration: "300", hideDuration: "1000", timeOut: "20000", extendedTimeOut: "1000", showEasing: "swing", hideEasing: "linear", showMethod: "fadeIn", hideMethod: "fadeOut" }; </script> //常规消息提示,默认背景为浅蓝色 toastr.info("你有新消息了!");<br> <script>toastr.info("你有新消息了!");</script><br> //成功消息提示,默认背景为浅绿色 toastr.success("你有新消息了!"); <script>toastr.success("你有新消息了!");</script><br> //警告消息提示,默认背景为橘黄色 toastr.warning("你有新消息了!"); <script>toastr.warning("你有新消息了!");</script><br> //错误消息提示,默认背景为浅红色 toastr.error("你有新消息了!"); <script>toastr.error("你有新消息了!");</script><br> //带标题的消息框 toastr.success("你有新消息了!","我有标题"); <script>toastr.success("你有新消息了!","我有标题"); </script><br> </div> </div> </body> </html>
运行结果