Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
273 views
in Technique[技术] by (71.8m points)

javascript - 将工具提示添加到div(Add a tooltip to a div)

I have a div tag like this:

(我有这样的div标签:)

<div>
  <label>Name</label>
  <input type="text"/>
</div>

How can I displaying a tooltip on :hover of the div, preferably with a fade in/out effect.

(如何在div的:hover上显示工具提示,最好具有淡入/淡出效果。)

  ask by user475685 translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

For the basic tooltip, you want:

(对于基本工具提示,您需要:)

<div title="This is my tooltip">

For a fancier javascript version, you can look into:

(对于更高级的javascript版本,您可以查看以下内容:)

https://jqueryhouse.com/best-jquery-tooltip-plugins/

(https://jqueryhouse.com/best-jquery-tooltip-plugins/)

The above link gives you 25 options for tooltips.

(上面的链接为您提供了25个工具提示选项。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...