美文网首页
JGrowl 气泡提示框插件的使用

JGrowl 气泡提示框插件的使用

作者: Vincent_Jiang | 来源:发表于2017-03-14 14:02 被阅读120次

导入必须的文件

<link href="jquery.jgrowl.min.css" rel="stylesheet" />
<script src="jquery-3.1.0.min.js"></script>
<script src="jquery.jgrowl.min.js"></script>

Sample 1:提示后自动消息

$.jGrowl("Hello world!");

Sample 2:需要用户手动关闭

$.jGrowl("Stick this!", { sticky: true });

Sample 3:增加标题

$.jGrowl("A message with a header", { header: 'Important' });

Sample 4:指定在10秒后自动消失

$.jGrowl("A message that will live a little longer.", { life: 10000 });

Sample 5:消失后有回调事件

$.jGrowl("A message with a beforeOpen callback and a different opening animation.", {
    beforeClose: function(e,m) {
        alert('About to close this notification!');
    },
    animateOpen: {
        height: 'show'
    }
});

相关文章

网友评论

      本文标题:JGrowl 气泡提示框插件的使用

      本文链接:https://www.haomeiwen.com/subject/xgxhnttx.html