漂亮灵活设置的jquery通知提示插件toastr
toastr是一款非常棒的基于jquery库的非阻塞通知提示插件,toastr可设定四种通知模式:成功,出错,警告,提示,而提示窗口的位置,动画效果都可以通过能数来设置,在官方站可以通过勾选参数来生成JS,非常的方便使用。jQ酷的另外一款jquery提示插件也不错:jQuery自定义工具提示插件DarkTooltip。
使用方法:
引入核心文件
|
1
2
3
|
<link href="toastr.css" rel="stylesheet" type="text/css" /><script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script><script src="toastr.js"></script> |
写入html代码,这里只需写入触发事件的按丑。
|
1
2
3
4
5
|
<input type="button" name="success" id="success" value="成功"/><input type="button" name="info" id="info" value="提示"/><input type="button" name="warning" id="warning" value="警告"/><input type="button" name="error" id="error" value="错误"/><input type="button" name="clear" id="clear" value="清除"/> |
给按钮绑定事件
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
$(function(){ //参数设置,若用默认值可以省略以下面代 toastr.options = { "closeButton": false, //是否显示关闭按钮 "debug": false, //是否使用debug模式 "positionClass": "toast-top-full-width",//弹出窗的位置 "showDuration": "300",//显示的动画时间 "hideDuration": "1000",//消失的动画时间 "timeOut": "5000", //展现时间 "extendedTimeOut": "1000",//加长展示时间 "showEasing": "swing",//显示时的动画缓冲方式 "hideEasing": "linear",//消失时的动画缓冲方式 "showMethod": "fadeIn",//显示时的动画方式 "hideMethod": "fadeOut" //消失时的动画方式 }; //成功提示绑定 $("#success").click(function(){ toastr.success("祝贺你成功了"); }) //信息提示绑定 $("#info").click(function(){ toastr.info("这是一个提示信息"); }) //敬告提示绑定 $("#warning").click(function(){ toastr.warning("警告你别来烦我了"); }) //错语提示绑定 $("#error").click(function(){ toastr.error("出现错误,请更改"); }) //清除窗口绑定 $("#clear").click(function(){ toastr.clear(); }) }) |
转载请注明:jQ酷 » 漂亮灵活设置的jquery通知提示插件toastr
漂亮灵活设置的jquery通知提示插件toastr的更多相关文章
- Jquery消息提示插件toastr使用详解
toastr是一个基于jQuery简单.漂亮的消息提示插件,使用简单.方便,可以根据设置的超时时间自动消失. 1.使用很简单,首选引入toastr的js.css文件 html <script s ...
- Jquery消息提示插件toastr使用
toastr是一个基于jQuery简单.漂亮的消息提示插件,使用简单.方便,可以根据设置的超时时间自动消失. 相关文件到官网去下载即可 1.引入toastr的js和css文件 <link hre ...
- Jquery消息提示插件toastr
toastr是一个基于jQuery简单.漂亮的消息提示插件,使用简单.方便,可以根据设置的超时时间自动消失. 1.使用很简单,首选引入toastr的js.css文件 <script src=&q ...
- 消息提示插件toastr.js与Messenger组件
Toastr是一款基于jQuery的通知插件,可以灵活的自定义样式和拓展其功能! toastr是一个基于Jquery简单.漂亮的消息提示插件,使用简单.方便,可以根据设置的超时时间自动消失. cdn最 ...
- toastr 通知提示插件
table.sb-tb td,table.sb-tb th { padding: 5px 10px !important } jquery toastr 一款轻量级的通知提示框插件. 网页开发中经常会 ...
- PoshyTip jQuery 文本提示插件的使用
PoshyTip 是JQuery中一款文本提示插件,在Jsp页面使用相当方便,插件内包含了很多外观样式,可以作为FormTooltips使用. 插件包下载地址:http://vadikom.com/f ...
- 介绍Web项目中用到的几款JQuery消息提示插件
第一款 noty 官方网站:https://github.com/needim/noty 第二款 artDialog artDialog是一个精巧的web对话框组件,压缩后只有十多KB,并且不依赖其他 ...
- Jquery 错误提示插件
这是一个简单的输入框错误提示插件,可拓展! .jq-error{ font-size:12px; min-width:150px; width:auto; max-width:350px; line- ...
- TaggingJS – 可以灵活定制的 jQuery 标签系统插件
TaggingJS 是一款 jQuery 插件,用来创建高度可定制的前端标签系统.这款插件不到3KB ,支持主流浏览器.有几种方法来定制 TaggingJS 的默认行为:一是使用 custom_op ...
随机推荐
- 消除SDK更新时的“https://dl-ssl.google.com refused”异常
原地址:http://blog.csdn.net/x605940745/article/details/17911115 消除SDK更新时的“https://dl-ssl.google.com ref ...
- hdu 4324 Triangle LOVE(拓扑排序,基础)
题目 /***************************参考自****************************/ http://www.cnblogs.com/newpanderking ...
- utmp, wtmp, and lastlog 日志清除工具
utmp, wtmp, and lastlog 日志清除工具 http://blog.itpub.net/83980/viewspace-801664/
- Openfire 代码部署报错: Variable references non-existent resource:${workspace_loc:openfire_src}
Variable references non-existent resource:${workspace_loc:openfire_src} -DopenfireHome=“${workspace_ ...
- BZOJ 3198 SDOI2013 spring
为什么SDOI省选一年考两次容斥原理? 我们很容易发现>=k个相等时很好计算的 但是我们要求恰好k个,那么我们容斥即可 至于计算>=k个相等,首先我们枚举相等位置,对每个串对应位置做一遍h ...
- lintcode:previous permutation上一个排列
题目 上一个排列 给定一个整数数组来表示排列,找出其上一个排列. 样例 给出排列[1,3,2,3],其上一个排列是[1,2,3,3] 给出排列[1,2,3,4],其上一个排列是[4,3,2,1] 注意 ...
- java中什么时候该用static修饰方法?有什么好处或者坏处?
当一个方法或者变量需要初始化加载,或者是经常被调用的时候可以加上static.用static修饰的方法可以用类名直接调用,不用的一定要先实例化一个对象然后才可以调用比如 person这个类里面有一个方 ...
- iOS 中有用的开源库
youtube下载神器:https://github.com/rg3/youtube-dl vim插件:https://github.com/Valloric/YouCompleteMe vim插件配 ...
- ScannerTest-------double string
import java.util.*; public class ScannerTest { public static void main(String[] args){ Scanner scann ...
- Android:PopupWindow简单弹窗
两布局,一个当前布局页面和一个点击展示布局页面,主程序代码: public class MainActivity extends Activity { private PopupWindow pop; ...