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
3 Answers
Reset to default 2Not 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条)