mootools tooltip

<a class="tooltipA" title="1st Tooltip Title" rel="here is the default 'text' of 1" href="http://www.consideropen.com">Tool tip 1</a>

 

var customTips = $$('.tooltipA');

var toolTips = new Tips(customTips); 

 

showDelay//默认值为100,一个以毫秒为单位的整数,这将决定工具提示在鼠标移动到元素上面多久后再显示出来。

hideDelay//默认值为100,和上面的showDelay一样,不过这个值(也是以毫秒为单位)将决定当鼠标离开元素多久以后隐藏工具提示。

className//默认为null,就像你在上面的示例中看到的一样,这可以让你为工具提示容器设置一个CSS类名。

offsets//默认为 x:16, y:16

fixed//默认为false,这个设置决定了当你的鼠标在元素上面移动时,这个工具提示是否跟随鼠标。

 

 事件

onShow//这个事件将在工具条显示的时候触发。

onHide//和上面的onShow事件一样,相对地,它是在工具提示隐藏时触发。

 

方法

 

.attach();//要给一个新的元素添加一个工具提示,你只需要在Tip对象的后面加上.attach();,最后再把这个元素的选择器放在括号里面。

.dettach();

 

// 你可以用.store();方法来改变rel的值

// 从而改变工具提示的值

// 你可以使用下面的代码

$('tooltipID1').store('tip:text', 'You can replace the href with whatever text you want.');

 

$('tooltipID1').store('tip:title', 'Here is a new title.'); 

// 下面的代码将改不会改变工具提示的文本

$('tooltipID1').set('rel', 'This will not change the tooltips text');

$('tooltipID1').set('title', 'This will not change the tooltips title');


 


posted @ 2009-12-21 15:12  kid的笔记本  阅读(243)  评论(0编辑  收藏  举报