JGrowl 气泡提示框插件的使用

2017-03-14  本文已影响120人  Vincent_Jiang

导入必须的文件

<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'
    }
});
上一篇 下一篇

猜你喜欢

热点阅读