原文http://www.stanlemon.net/projects/jgrowl.html
水平有限,可能翻译会误导群众,请见谅.
使用Mac的朋友可能有在使用Growl,这款软件的主要作用是将应用程序输出的一些提示,错误显示出来,想tips一样,比如我用的fit输入法,当我从中文切换到英文的时候,右上角会出现提示.
jGrowl就是web的Growl,它运行时需要 jQuery
以下是官网的资源
引用
jGrowl's jQuery Plugin Page
Checkout the source code with Mercurial on BitBucket
Updates on Development.
Example Usage and Samples
Explanation of jGrowl Options
Version Change Log
例子
引用
[code="html"]// Sample 1
$.jGrowl("Hello world!");
// Sample 2
$.jGrowl("Stick this!", { sticky: true });
// Sample 3
$.jGrowl("A message with a header", { header: 'Important' });
// Sample 4
$.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'
}
});
参数选项
名称 | 默认值 | 说明 |
header | 空 | 标题 |
sticky | false | 如果设置这个选项的话,你必须手动关闭提示 |
glue | after | 消息队列的方向,默认是新消息在旧消息下边显示,可选值(after,before) |
position | top-right | 消息显示位置,top-left, top-right, bottom-left, bottom-right, center |
theme | default | 消息提示框 classname |
corners | 10px | 圆角半径 |
check | 1000 | 检查屏幕上已过期消息的频率 |
life | 3000 | 设置sticky的提示框存在周期 |
speed | normal | 开关对话动画速度 可选值(slow,normal,fast) |
easing | swing | |
closer | true | 是否显示一个关闭所有提示的按键 |
closeTemplate | × | 关闭按键的内容,样式 |
closerTemplate | <div>[ close all ]</div> | 全部关闭按键的内容,样式 |
log | function(e,m,o) {} | 提示前触发(全局)的回调函数,参数 提示的dom,消息内容,这个的选项 |
beforeOpen | function(e,m,o) {} | 消息被打开前触发的回调函数,参数同上 |
open | function(e,m,o) {} | 消息被打开后触发的回调函数,参数同上 |
beforeClose | function(e,m,o) {} | 消息被关闭前触发的回调函数,参数同上 |
close | function(e,m,o) {} | 消息被关闭后触发的回调函数,参数同上 |
animateOpen | { opacity: 'show' } | 打开消息窗口的动画选项默认是:fadeOut |
animateClose | { opacity: 'hide' } | 关闭消息窗口的动画选项默认是:fadeIn |