View Full Version : How do I emulate a mouse over event?

Joder Illi
02-14-2007, 11:34 AM
Hi, I got an issue with javascript. I need to enable keyboard navigation for a list of links, so that pressing UP/DOWN arrow keys acts like you put your mouse over the previous/next link. I allready have acomplished "lighting" the links by defining some "fake" mouse over style in CSS (that is applied to the link when you select it with the cursor keys) like this:

a.linklist:hover, a.linklist:active, a.keyboardSelected:link, a.keyboardSelected:visited {...;...;...}

The truoble I've got now is that some links are too long to fit in the list, so I shortened the link text and did put the full link in the "title" attribute of the link. This makes appear the full link as a tooltip when you hoover with your mouse over the link, but (as expected) the tooltip doesent appear when you select the link with the keyboard arrows. I have allready considered using javascript tooltips, but I would preffer the standart "title" tooltip because I don't want to add much more "weight" to my script.

Does anybody have an idea about how to emulate an onMouseOver() event or how to force the "title" tooltip to appear on certain event?

If you need some more of my code, just tell me.

Thank you for your time.

Joder Illi

02-14-2007, 09:45 PM
You are going to have to develop or use a tooltip script.