Jquery消息提示插件toastr
2017-06-27 17:17
417 查看
toastr是一个基于jQuery简单、漂亮的消息提示插件,使用简单、方便,可以根据设置的超时时间自动消失。
1、使用很简单,首选引入toastr的js、css文件
html
2
1
2
2、效果
3、集成使用
2
1
2
2
1
2
2
1
2
2
1
2
2
1
2
2
1
2
4、自定义用法
通过设置自定义参数,可达到不同的效果
自定义参数:
JavaScript
2
3
4
5
6
7
8
9
10
11
12
13
14
15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
参数说明:
closeButton:false,是否显示关闭按钮(提示框右上角关闭按钮);
debug:false,是否为调试;
progressBar:false,是否显示进度条(设置关闭的超时时间进度条);
positionClass,消息框在页面显示的位置
2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
onclick,点击消息框自定义事件
showDuration: “300”,显示动作时间
hideDuration: “1000”,隐藏动作时间
timeOut: “2000”,自动关闭超时时间
extendedTimeOut: “1000”
showEasing: “swing”,
hideEasing: “linear”,
showMethod: “fadeIn” 显示的方式,和jquery相同
hideMethod: “fadeOut” 隐藏的方式,和jquery相同
1、使用很简单,首选引入toastr的js、css文件
html
<script src="<%=path%>/res/toastr/toastr.min.js"></script> <link rel="stylesheet" href="<%=path%>/res/toastr/toastr.min.css">1
2
1
2
2、效果
3、集成使用
//常规消息提示,默认背景为浅蓝色 toastr.info("你有新消息了!");1
2
1
2
//成功消息提示,默认背景为浅绿色 toastr.success("你有新消息了!");1
2
1
2
//警告消息提示,默认背景为橘黄色 toastr.warning("你有新消息了!");1
2
1
2
//错误消息提示,默认背景为浅红色 toastr.error("你有新消息了!");1
2
1
2
//带标题的消息框 toastr.success("你有新消息了!","消息提示");1
2
1
2
//另一种调用方法 toastr["info"]("你有新消息了!","消息提示");1
2
1
2
4、自定义用法
通过设置自定义参数,可达到不同的效果
自定义参数:
JavaScript
toastr.options = { closeButton: false, debug: false, progressBar: true, positionClass: "toast-bottom-center", onclick: null, showDuration: "300", hideDuration: "1000", timeOut: "2000", extendedTimeOut: "1000", showEasing: "swing", hideEasing: "linear", showMethod: "fadeIn", hideMethod: "fadeOut" };1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
参数说明:
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-left toast-bottom-center toast-bottom-full-width1
2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
onclick,点击消息框自定义事件
showDuration: “300”,显示动作时间
hideDuration: “1000”,隐藏动作时间
timeOut: “2000”,自动关闭超时时间
extendedTimeOut: “1000”
showEasing: “swing”,
hideEasing: “linear”,
showMethod: “fadeIn” 显示的方式,和jquery相同
hideMethod: “fadeOut” 隐藏的方式,和jquery相同
相关文章推荐
- Jquery消息提示插件toastr使用详解
- Jquery消息提示插件toastr使用详解
- Jquery消息提示插件toastr使用详解
- Pines Notify jQuery Plugin:好看易用的jQuery消息提示插件
- Pines Notify jQuery Plugin:好看易用的jQuery消息提示插件
- toastr jQuery消息通知插件文档
- jquery--jQuery插件【capacityFixed-类似于新浪微博新消息提示的定位框的实例页面】
- jQuery消息提示框插件Tipso
- Pines Notify jQuery Plugin:好看易用的jQuery消息提示插件
- jquery插件:仿百度首页可展开收起的消息提示控件
- jQuery消息提示框插件Tipso
- JBox - 模态窗口,工具提示和消息 jQuery 插件
- jquery poshytip消息提示插件使用
- [转]灵活的jQuery消息提示插件 - Backbone.Notifier
- 基于jQuery消息提示框插件Tipso
- 基于jQuery的消息提示插件之旅 DivAlert(三)
- 【jQuery插件】capacityFixed-类似于新浪微博新消息提示的定位框
- 一个超棒的消息提示jQuery插件 - Noty
- 一个超棒的消息提示jQuery插件 - Noty
- jQuery消息提示框插件Tipso