Hello.
upd: Solution found. Solution in the answers.
First, some code, then the problem:
HTML:
<div style="background:#ccc" onmouseover="over()"> <a href="#">link</a> <a href="#">another link</a> </div> Javascript:
function over() { alert('over'); } The problem is that the onmouseover event re-fires when you hover on any of the links, even if the mouse pointer was previously in the div boundaries.
The question is how to get around this mechanism. I need the event to be triggered only at the moment when the user hovers the mouse over the div .
The same problem is observed with onmouseout , but it seems to me that their solutions should be similar.
A piece of context for understanding the problem:
There is a cascade menu.
Submenus pops up using JS for the client does not like their instant appearance when implemented through CSS.
The problem is that the process of drawing a submenu is repeated when you hover on its items.
div-e, but re-fires when you hover over the links in thisdiv-e contained. I don’t work very closely with JS, so I’m probably misunderstanding something. If so, please correct me. - ikoolik