javascript - Programmatically displaying HTML element titles - Stack Overflow

Is there a javascript way to display or hide element title (defined as an html attribute), as if the mo

Is there a javascript way to display or hide element title (defined as an html attribute), as if the mouse was hovering above said dom element, without actually involving the mouse?

Thanks in advance.

Is there a javascript way to display or hide element title (defined as an html attribute), as if the mouse was hovering above said dom element, without actually involving the mouse?

Thanks in advance.

Share Improve this question asked Jan 21, 2011 at 23:32 Dennis KreminskyDennis Kreminsky 2,08916 silver badges23 bronze badges 3
  • 1 The native UI tooltips? No. If you make your own tooltips in JS? Sure. – thirtydot Commented Jan 21, 2011 at 23:36
  • This is pletely contrary to how the user expects a UI to behave. Why on earth would you want to do this? – Lightness Races in Orbit Commented Jan 22, 2011 at 0:39
  • Predicting what the user expects from UI is a rather plex thing, isn't it? Tooltips are situational suggestions, and user input (situation) is not limited to mouse events. Specifically, when user is typing in a search field that has no visual submit button, we could suggest him to press 'Enter' when ready. – Dennis Kreminsky Commented Jan 22, 2011 at 9:54
Add a ment  | 

3 Answers 3

Reset to default 2

Not with native tooltips/titles. But there are jQuery plugins like this which let you cutomize and control them.

I would use an absolutely positioned DIV that looks like the native tooltip and contains the same text as an alternative. It should be fairly trivial to loop through all elements and create a DIV for each one that has a title attribute.

Very little hassle and no JavaScript plugins required.

You can make a tooltip layout (div with border) yourself, and show it when you want with jQuery. You can select a link element with a title like this:

a[title] {}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745422842a4627043.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信