jQuery插件之-Poshy Tip

 

jQuery插件Poshy Tip是一个强大的jQuery Tooltips插件,它有多种不同的外观。同时可以作为 Form Tooltips使用,并且可以自定义气泡出现的位置。在处理表单验证提示上能带来更好的浏览体验,已经减少自己编写的代码量。
先来个截图:

Poshy Tip

Poshy Tip

插件拥有的参数:

01// default settings
02    $.fn.poshytip.defaults = {
03        content:       '[title]'// content to display ('[title]', 'string', element, function(updateCallback){...}, jQuery)
04        className:     'tip-yellow',  // class for the tips
05        bgImageFrameSize:   10,    // size in pixels for the background-image (if set in CSS) frame around the inner content of the tip
06        showTimeout:        500,       // timeout before showing the tip (in milliseconds 1000 == 1 second)
07        hideTimeout:        100,       // timeout before hiding the tip
08        showOn:        'hover',   // handler for showing the tip ('hover', 'focus', 'none') - use 'none' to trigger it manually
09        alignTo:       'cursor',  // align/position the tip relative to ('cursor', 'target')
10        alignX:        'right',   // horizontal alignment for the tip relative to the mouse cursor or the target element
11                            // ('right', 'center', 'left', 'inner-left', 'inner-right') - 'inner-*' matter if alignTo:'target'
12        alignY:        'top',     // vertical alignment for the tip relative to the mouse cursor or the target element
13                            // ('bottom', 'center', 'top', 'inner-bottom', 'inner-top') - 'inner-*' matter if alignTo:'target'
14        offsetX:        -22,       // offset X pixels from the default position - doesn't matter if alignX:'center'
15        offsetY:        18,    // offset Y pixels from the default position - doesn't matter if alignY:'center'
16        allowTipHover:     true,      // allow hovering the tip without hiding it onmouseout of the target - matters only if showOn:'hover'
17        followCursor:      false,     // if the tip should follow the cursor - matters only if showOn:'hover' and alignTo:'cursor'
18        fade:          true,      // use fade animation
19        slide:         true,      // use slide animation
20        slideOffset:        8,     // slide animation offset
21        showAniDuration:    300,       // show animation duration - set to 0 if you don't want show animation
22        hideAniDuration:    300    // hide animation duration - set to 0 if you don't want hide animation
23    };

插件拥有的方法:

01show
02.poshytip('show')//显示tooltip 。这里需要确保在触发事件前 alignTo 参数被设置为 'target'
03hide
04.poshytip('hide')//隐藏tooltip
05disable
06.poshytip('disable')//禁用tooltip
07enable
08.poshytip('enable')//启用tooltip
09destroy
10.poshytip('destroy'//解除tooltip功能

注意事项:
jQuery版本要求1.4+
插件兼容 IE6+, FF 2+, Opera 9+, Safari 3+, Chrome
tooltip 的DIV容器支持在IE6中使用min/max-width(只限于px像素值),可以不用特意为IE6做hack
当使用图片来作为容器背景的时候,脚本将自动忽略background-color/padding/border属性的设置,并围绕背景图片创建tooltip 容器
PNG背景图片在IE6中不被支持(只有GIF支持),如果将一个PNG图片设为背景图片,在IE6中将自动用background-color/padding/border属性来替换掉图片背景

如果想知道如何自己制作tooltip 的外观,可以查看官方的说明,地址:http://vadikom.com/tools/poshy-tip-jquery-plugin-for-stylish-tooltips/

官方DEMO地址:http://vadikom.com/demos/poshytip/
官方下载地址:http://vadikom.com/files/?file=poshytip/poshytip-1.0.zip
本地下载:poshytip-1.0

 

转载地址:http://www.xiaoningmeng.com/2010/08/jquery-plug-in-the-poshy-tip/

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值