网页特效栏目收集了最全最新的前端网页插件,包括最流行的jQuery,Bootstrap,Js,Css,Vue等主流特效插件。
Notific是一个强大的jQuery通知插件,创建可定制、无阻塞、动画消息通知窗口。
特点:
6种标志类型:默认情况下,成功,信息,错误,警告,加载程序。
9个组合位置。
可定制的图标和边框框大小。
到时间窗口后自动消失。
1.在html页面中加载jquery库和插件文件。
<link rel="stylesheet" href="notific.css" />
<script src="jquery.min.js"></script>
<script src="notific.js"></script>
2.通知类型如下:
Message.add('Default notification');
Message.add('Success notification', {type: 'success'});
Message.add('Info notification', {type: 'info'});
Message.add('Warning notification', {type: 'warning'});
Message.add('Error notification', {type: 'error'});
Message.add('Loader notification', {type: 'loader',return:'object'});
3. 确定通知窗口的位置vertical和horizontal选项。
Message.add('Top Left Notification',{vertical:'top',horizontal:'center'});
4. 自定义通知窗口的大小。
// Medium Icon
Message.add('Medium Icon notification',{skin:'ico-medium'});
// Large Icon
Message.add('Large Icon notification', {skin:'ico-large'});
// Large Notification
Message.add('Large notification', {skin:'large'});
// Large Size + Medium Icon notification
Message.add('Large Size + Medium Icon notification', {skin:'large ico-medium'});
5. 覆盖默认的通知窗口显示时间。 默认值:2000 ms。
Message.add('Auto Dismiss After 10s', {
life: '10000'
});
6. 通知窗口一直可见,点击关闭按钮才能消失。
Message.add('Sticky Notification', {
sticky: true
});
7. 覆盖通知窗口默认风格
Message.init({
style:'.notic { color: #222 }'
});
8. 更多的配置默认值。
Message.add('Custom Notification', {
// where the notification box should appear
selector: 'body',
// 'prepend'|'append'
insert: 'append',
// animation speed
timeIn: 400,
timeOut: 1000,
// whether to show icons
icon: true,
// whether to show close button
close: true,
// additional CSS styles here
style: ''
});
9. 设置提示内容。
var myLoader = Message.add('Connecting to the server!', {
type: 'loader'
});
Message.replace('Successful download message', myLoader, {
type:'success',
life:3000
});
10.手动关闭通知框。
var element = Message.add('Connecting to the server!', {
type: 'loader',
return:'object'
});
Message.close(element,1000);
转载请注明来源:jquery(Notific)无阻塞消息推送/通知插件
本文永久链接地址:https://www.moyouyouw.cn/code/695.html
郑重声明:本站所有主题/文章除标明原创外,均来自网络转载,版权归原作者所有,如果有侵犯到您的权益,请联系本站删除,谢谢!我们不承担任何技术及版权问题,且不对任何资源负法律责任。
已有 位小伙伴发表了看法
欢迎 你 发表评论