网页特效栏目收集了最全最新的前端网页插件,包括最流行的jQuery,Bootstrap,Js,Css,Vue等主流特效插件。
这是一款轻量级,简单的,可定制的jquery toast通知插件,滑动,堆叠,非阻塞的通知弹出窗口,模仿Android Toast。
1. 在html文档中插入jquery.toasts.css和JavaScriptjquery.toasts.js文件。
<script src="jquery.min.js"></script>
<link rel="stylesheet" href="jquery.toasts.css" />
<script src="jquery.toasts.js"></script>
2. 只需在元素上定义toast属性,即可显示toast通知弹框。
<button toast="这是一个简单的toast弹框">简单的Toast</button>
3. toast自动消失时间。默认值:5000ms。
<button toast="这是一个简单的toast弹框" toast-timeout="1000">简单的Toast</button>
4.在toast消息中显示关闭按钮。
<button toast="这是一个简单的toast弹框<a class='close'>×</a>">简单的Toast</button>
5. 还可以通过方式创建toast消息:
$.toast('Example Toast!');
$.toast('Example Toast!', 1000);
$.toast('Example Toast! <a class="close">×</a>');
6.当用户单击toast函数时执行消息弹框。
$.toast(
'Click me!', // content
5000, // timeout
function () {
alert('Hello world!');
} // click event
);
7. 当用户将鼠标悬停在toast消息上时执行函数。
$.toast(
'Hover me!', // content
5000, // timeout
function () { }, // click event
function () { }, // closed event
function () {
alert('Hi :)');
} // mouse enter event
);
8. 当光标移出toast消息时执行函数。
$.toast(
'Hover me!', // content
5000, // timeout
function () { }, // click event
function () { }, // closed event
function () { }, // mouse enter event
function () {
alert('Bye');
} // mouse leave event
);
转载请注明来源:jQuery高级Toast消息通知插件
本文永久链接地址:https://www.moyouyouw.cn/code/787.html
郑重声明:本站所有主题/文章除标明原创外,均来自网络转载,版权归原作者所有,如果有侵犯到您的权益,请联系本站删除,谢谢!我们不承担任何技术及版权问题,且不对任何资源负法律责任。
已有 位小伙伴发表了看法
欢迎 你 发表评论