Toastr消息提示框的使用
来源:互联网 发布:movo润滑液 知乎 编辑:程序博客网 时间:2024/05/16 17:54
toastr是一个基于jQuery简单、漂亮的消息提示插件,使用简单、方便,可以根据设置的超时时间自动消失。
1、使用很简单,首选引入toastr的js、css文件
<script type="text/javascript" src="../lib/toastr/toastr.js"></script><link href="../lib/toastr/toastr.css" rel="stylesheet"/>
2、效果
3、集成使用
//常规消息提示,默认背景为浅蓝色 toastr.info("你有新消息了!"); //成功消息提示,默认背景为浅绿色 toastr.success("你有新消息了!"); //警告消息提示,默认背景为橘黄色 toastr.warning("你有新消息了!"); //错误消息提示,默认背景为浅红色 toastr.error("你有新消息了!"); //带标题的消息框toastr.success("你有新消息了!","消息提示"); //另一种调用方法toastr["info"]("你有新消息了!","消息提示");
4、自定义用法
通过设置自定义参数,可达到不同的效果
自定义参数:
参数说明: closeButton:false,是否显示关闭按钮(提示框右上角关闭按钮); debug:false,是否为调试; progressBar:false,是否显示进度条(设置关闭的超时时间进度条); positionClass,消息框在页面显示的位置toast-top-left 顶端左边toast-top-right 顶端右边toast-top-center 顶端中间toast-top-full-width 顶端,宽度铺满整个屏幕toast-botton-right toast-bottom-lefttoast-bottom-centertoast-bottom-full-widthonclick,点击消息框自定义事件 showDuration: “300”,显示动作时间 hideDuration: “1000”,隐藏动作时间 timeOut: “2000”,自动关闭超时时间 extendedTimeOut: “1000” showEasing: “swing”, hideEasing: “linear”, showMethod: “fadeIn” 显示的方式,和jquery相同 hideMethod: “fadeOut” 隐藏的方式,和jquery相同
阅读全文
0 0
- Toastr消息提示框的使用
- jquery toastr提示框的使用
- Jquery消息提示插件toastr使用详解
- Jquery消息提示插件toastr
- 消息提示插件:toastr.js
- 一个好看的弹出提示框样式,toastr插件的使用及动态展示分析
- 在项目中使用js的提示插件toastr
- 简单好用的消息通知插件toastr
- Toast简易消息提示框的使用
- toastr 插件使用
- 3、js插件---->jquery通知插件toastr的使用
- 项目中用到的一个小插件,基于jQuery的消息提醒 toastr.js
- toastr jQuery消息通知插件文档
- angular定制组件-toastr(消息提醒)
- angular定制组件-toastr(消息提醒)
- Android消息提示框和对话框的使用
- Android Toast简易消息提示框的使用
- Android Toast简易消息提示框的使用
- 百练2819:W的密码题解
- 指针、内存操作中的一些其它注意点
- oracle undo segments, do blocks
- 用哈希算法的思想解决排序和字符串去重问题,时间复杂度为O(N)
- Matrx的数学原理
- Toastr消息提示框的使用
- PYTHON机器学习实战——集成学习 AdaBoost元算法
- TensorFlow运行MNIST样例碰到下载数据的问题
- shell编程之环境变量配置文件
- 【程序】Marvell 88W8686 WiFi模块与SD内存卡同时插在SDIO总线上的初始化代码
- RE:JAVA学习-方法调用
- HTB内部实现分析(转)
- 使用select需要注意的细节
- 百练2820:古代密码题解