when a container, such as Div , when no elements are included. Onmouseover is performed only once, normally. When this div contains other child elements, the event is executed several times, and today, this is the problem, and the solution is hereby documented.
This is because onmouseover Span style= "Font-family:helvetica" >ul li Span style= "Font-family:helvetica" >ul onmouseover
1 , if it is IE Browser, with OnMouseLeave instead.
2 , no matter what browser, the following method is very cool, do not believe, you try.
- ? statelist.onmouseout?=? function(e) {????
- ?? if(?! E?)? e?=?window.event;????
- ?? var? Reltg?=?e.relatedtarget??? e.relatedtarget?:?e.toelement;????
- ?? While (? reltg?&&?reltg?! =? This ?)? Reltg?=?reltg.parentnode;????
- ?? if(? reltg?! =? This ?) {????
- ?????? //?è?? E???? ˉt?? ¥?? –???? OnMouseLeave?? o?????? "? ¤"????? £????? ??
- ???? statelist.style.display=' None ';??
- ?}??
- }??
The original is here: http://blog.csdn.net/teresa502/article/details/6103458
onMouseOver is called multiple times