jGrowl 基于jQuery的消息弹出框插件

jGrowl 基于jQuery的消息弹出框插件

// 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'
}
});

Option Name:Default Value:Explanation:
headerempty string可选,设置消息框的标题内容。(Optional header to prefix the message, this is often helpful for associating messages to each other.)
stickyfalse可选,设置为ture时,由用户点击关闭才消息。(When set to true a message will stick to the screen until it is intentionally closed by the user.)
glueafterDesignates whether a jGrowl notification should be appended to the container after all notifications, or whether it should be prepended to the container before all notifications. Options are after or before.
positiontop-right消息框的位置,分top-left, top-right, bottom-left, bottom-right, center。(Designates a class which is applied to the jGrowl container and controls it’s position on the screen. By Default there are five options available, top-left, top-right, bottom-left, bottom-right, center. This must be changed in the defaults before the startup method is called.)
themedefault指定Css样式。(A CSS class designating custom styling for this particular message.)
corners10px圆角的曲率半径。(If the corners jQuery plugin is include this option specifies the curvature radius to be used for the notifications as they are created.)
check1000(The frequency that jGrowl should check for messages to be scrubbed from the screen.)
life3000消息框在多长时间后自动消失,默认为3秒。(The lifespan of a non-sticky message on the screen.)
speednormal打开或关闭时是否使用动画。(The animation speed used to open or close a notification.)
easingswing(The easing method to be used with the animation for opening and closing a notification.)
closertrue是否出现关闭按钮。(Whether or not the close-all button should be used when more then one notification appears on the screen. Optionally this property can be set to a function which will be used as a callback when the close all button is clicked.)
closeTemplate×This content is used for the individual notification close links that are added to the corner of a notification.
closerTemplate<div>[ close all ]</div>This content is used for the close-all link that is added to the bottom of a jGrowl container when it contains more than one notification.
logfunction(e,m,o) {}Callback to be used before anything is done with the notification. This is intended to be used if the user would like to have some type of logging mechanism for all notifications passed to jGrowl. This callback receives the notification’s DOM context, the notifications message and it’s option object.
beforeOpenfunction(e,m,o) {}在打开消息框之前提示触发此事件。(Callback to be used before a new notification is opened. This callback receives the notification’s DOM context, the notifications message and it’s option object.)
openfunction(e,m,o) {}Callback to be used when a new notification is opened. This callback receives the notification’s DOM context, the notifications message and it’s option object.
beforeClosefunction(e,m,o) {}在消失之前触发此事件。(Callback to be used before a new notification is closed. This callback receives the notification’s DOM context, the notifications message and it’s option object.)
closefunction(e,m,o) {}Callback to be used when a new notification is closed. This callback receives the notification’s DOM context, the notifications message and it’s option object.
animateOpen{ opacity: ’show’ }The animation properties to use when opening a new notification (default to fadeOut).
animateClose{ opacity: ‘hide’ }The animation properties to use when closing a new notification (defaults to fadeIn).

 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值