如何向div添加工具提示 [英] How to add a tooltip to a div
本文介绍了如何向div添加工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个div标签如下:
I have a div tag as follows:
<html>
<head></head>
<body>
<div>
<label>Name</label>
<input type="text"/>
</div>
</body>
</html>
现在我想要一个简单的javascript来显示工具提示:hover the div。有人可以帮助我吗?工具提示还应具有淡入/淡出效果。
Now I want a simple javascript for displaying a tooltip on :hover the div. Can someone please help me out? The tooltip should also have a fade in/out effect.
推荐答案
对于基本工具提示,您需要:
For the basic tooltip, you want:
<div title="This is my tooltip">
对于fancier的javascript版本,您可以查看:
For a fancier javascript version, you can look into:
http://www.designer-daily.com/jquery-prototype-mootool -tooltips-12632
上述链接提供了12个工具提示选项。
The above link gives you 12 options for tooltips.
这篇关于如何向div添加工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文