<!--jQuery文件--> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script> <!--noty主文件--> <script type="text/javascript" src="js/noty/jquery.noty.js"></script> <!--noty提示信息位置的文件, 需要哪些位置就引入对应的脚本,这里为center,可以添加多个布局文件--> <script type="text/javascript" src="js/noty/layouts/center.js"></script> <!--noty主题样式文件,--> <script type="text/javascript" src="js/noty/themes/default.js"></script>
$.noty.defaults = {
layout: 'top', // 默认布局
theme: 'defaultTheme', // 默认主题
type: 'alert', // 默认类型
text: '', //默认文本
dismissQueue: true, // 是否添加到队列
template: '<div class="noty_message"><span class="noty_text"></span><div class="noty_close"></div></div>', // 消息默认模板
animation: { //默认的显示及关闭动画
open: {height: 'toggle'},
close: {height: 'toggle'},
easing: 'swing',
speed: 500 // opening & closing animation speed
},
timeout: false, // 自动关闭时间,默认不会自动关闭
force: false, // 添加到队列开始处
modal: false, // 遮罩
maxVisible: 5, // 一个队列的消息最大可见数量, 即一个队列中同一时间最多显示的数量
closeWith: ['click'], // ['click', 'button', 'hover'] 关闭的事件,默认点击消息关闭
callback: { // 回调函数
onShow: function() {}, // 显示之前
afterShow: function() {}, // 显示之后
onClose: function() {}, // 关闭之前
afterClose: function() {} // 关闭之后
},
buttons: false // 按钮,用于在弹出的消息框中显示按钮
};
noty({
text: '你要继续吗?',
buttons: [
{addClass: 'btn btn-primary', text: '确定', onClick: function($noty) {
// this = button element 也就是当前的按钮
// $noty = $noty element 也就是当前这个提示信息对象
$noty.close();
noty({text: '你点击了确定按钮', type: 'success'});
}
},
{addClass: 'btn btn-danger', text: '取消', onClick: function($noty) {
$noty.close();
noty({text: '你点击了取消按钮', type: 'error'});
}
}
]
});
var n = noty({text: "noty - jQuery 通知插件 - 编程素材网 - http://www.1sucai.cn/jesu/"});
n.setText("囧月 - lwme.cnblogs.com"); // 更新内容
n.setTimeout(10000); // 设置超时时间
n.setType("error"); // 更新提示类型
n.close();
// 此外, noty还有几个属性用于查看它的状态
n.closed // 是否已关闭
n.showing // 是否正在显示
n.shown // 是否已显示
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有