topTips.js

工具提示,气泡提示 的实现。

License

MIT-style license.

Credits

The idea behind Tips.js is based on Bubble Tooltips (http://web-graphics.com/mtarchive/001717.php) by Alessandro Fulcitiniti http://web-graphics.com

概要
Tips.js 工具提示,气泡提示 的实现。
Tips 显示一个提示消息,以及/或相关链接

topTips

显示一个提示消息,以及/或相关链接

备注

文档需要XHTML格式

参数

elements 要添加tip的元素集
options 参考下面的可选项

可选项

maxTitleChars 提示的标题所能显示的最长字数。默认为 30.
showDelay onShow方法延迟执行的毫秒数 (默认为100 ms)
hideDelay onHide方法延迟执行的毫秒数  (默认为100 ms)
className 提示所用的样式名的前缀。默认为 ‘tool’.

整个提示的样式为: tool-tip

提示标题的样式为: tool-title

文本内容的样式为: tool-text

offsets 提示与鼠标的距离。一个包含x/y 属性的对象。
fixed 如果为true,则提示不会跟随鼠标移动。

事件

onShow 可选。可以用来覆盖默认的onShow的行为 
onHide 可选。可以用来覆盖默认的onHide的行为

示例

<img src="/images/i.png" title="The body of the tooltip isstored in the title" class="toolTipImg"/>
<script>
    var myTips = new Tips($$('.toolTipImg'), {
	maxTitleChars: 50
    });
</script>

备注

元素的title属性总会被作为提示的主内容. 如果你在title中输入 :: ,则 :: 前的内容将被作为提示的标题。

Documentation by Aaron Newton & Mootools Developers, generated by NaturalDocs and tidy, and GeSHi

文档中文翻译:zarknight 勘误Email:zarknight@gmail.com asp之家