jQuery - toastr消息提示插件(取代alter())

toastr插件详细参考资料

项目地址:https://github.com/CodeSeven/toastr

使用方法

(1)添加引用

    <!-- 消息提示 -->
    <link href="/assets/JS/plugins/bootstrap-toastr/toastr.min.css" rel="stylesheet" type="text/css" />
    <!--消息提示-->
    <script type="text/javascript" src="/assets/JS/plugins/bootstrap-toastr/toastr.min.js"></script>

(2)常用使用示例

// Display an info toast with no title
toastr.info(‘Are you the 6 fingered man?‘)
// Display a warning toast, with no title
toastr.warning(‘My name is Inigo Montoya. You killed my father, prepare to die!‘)

// Display a success toast, with a title
toastr.success(‘Have fun storming the castle!‘, ‘Miracle Max Says‘)

// Display an error toast, with a title
toastr.error(‘I do not think that word means what you think it means.‘, ‘Inconceivable!‘)

// Immediately remove current toasts without using animation
toastr.remove()

// Remove current toasts using animation
toastr.clear()

// Override global options
toastr.success(‘We do have the Kapua suite available.‘, ‘Turtle Bay Resort‘, {timeOut: 5000})
时间: 2024-08-24 14:22:30

jQuery - toastr消息提示插件(取代alter())的相关文章

Jquery消息提示插件toastr使用详解

toastr是一个基于jQuery简单.漂亮的消息提示插件,使用简单.方便,可以根据设置的超时时间自动消失. 1.使用很简单,首选引入toastr的js.css文件 html <script src="<%=path%>/res/toastr/toastr.min.js"></script> <link rel="stylesheet" href="<%=path%>/res/toastr/toastr

Jquery消息提示插件toastr使用

toastr是一个基于jQuery简单.漂亮的消息提示插件,使用简单.方便,可以根据设置的超时时间自动消失. 相关文件到官网去下载即可 1.引入toastr的js和css文件 1 <link href="/toastr/build/toastr.css" rel="stylesheet"> 2 <script src="/toastr/build/toastr.min.js"></script> 2.初始化to

toastr 消息提示用法

toastr是一个基于jQuery简单.漂亮的消息提示插件,使用简单.方便,可以根据设置的超时时间自动消失. 1.使用很简单,首选引入toastr的js.css文件 <script src="<%=path%>/res/toastr/toastr.min.js"></script> <link rel="stylesheet" href="<%=path%>/res/toastr/toastr.min.

jQuery打造智能提示插件二(可编辑下拉框)

在上一篇 jQuery打造智能提示插件 上改进,增加下拉按钮,修复点击下拉区域外不隐藏BUG 效果 下拉按钮素材: js封装,注意红色部分为BUG修复,然后传入boxwidth不带px: /* /// <reference path="jquery-autocomplete2.0.js" /> zhangs 20140516 */ (function($) { $.fn.combox = function(options) { var KEY = { UP: 38, DOW

SwwetAlert消息提示插件,支持手机移动响应式替换alert漂亮的消息提示插件

SwwetAlert 支持手机移动响应式消息提示插件 官方地址:http://tristanedwards.me/sweetalert IE11有闪退 IE11无闪退 地址:http://www.js-css.cn/jscode/tips/tips13/ 语法参考 swal("Good job!", "You clicked the button!", "success") 效果图 IE11无闪退JS (sweet-alert.min.js) !

jQuery打造智能提示插件

插件根据实际需要在单功能上封装的,实现传入后台数据地址,要保存值的input,前台要传入的参数(过滤条件),来返回下拉提示数据,数据过多可上下滚动选择,选择后显示文本与对应的值,供后台操作,如图: js封装: /* /// <reference path="jquery-autocomplete2.0.js" /> zhangs 20140516 */ (function($) { $.fn.combox = function(options) { var KEY = {

toastr 通知提示插件

table.sb-tb td,table.sb-tb th { padding: 5px 10px !important } jquery toastr 一款轻量级的通知提示框插件. 网页开发中经常会用到提示框,自带的alert样式无法调整,用户体验差. 所以一般通过自定义提示框来实现弹窗提示信息,而jquery toastr正是为此的一款非常棒的插件. 开发中用angular比较多,所以笔记记录了angular一些常见使用,与jquery版本有些许不同 ,相差不大. 在HTML引用js文件 <

jQuery 消息提示插件

常见消息提醒,类似于Chrome notification,易于使用,用户体验赞. // Simple $.sticky('hi, every body rock!'); // Advantage $.sticky({ icon : 'img/greet.png', title : 'Greeting', body : 'Hello there, I am jquery.sticky \(^o^)/~.', position : 'top-right', useAnimateCss: true,

基于JQuery 的消息提示框效果代码

提示框效果 一下是封装到 Jquery.L.Message.js 中的JS文件内容 var returnurl = ''; var messagebox_timer; $.fn.messagebox = function (message, url, type, delay) { clearTimeout(messagebox_timer); $("#msgprint").remove(); var m_body = $(this); delay = (typeof delay ==