Topic: [JAVASCRIPT DOM] Problem with SetTimeOut
Here's my script
count=1;
function drop(id,display) {
clearTimeout(count);
document.getElementById(id).style.display=display;
}function dropoff(id,display) {
count=setTimeout("document.getElementById(id).style.display=display",1000);
}
my function is called like that :
<a href="url.htm" onmouseover="drop('test2','block')" onmouseout="dropoff('test2','none')">Test Show/Hide Menu</A>
And of course, a div with id = test 2
<div id="test2">Blablablablabla</div>
When I onmouseover, if the div test is display : none ... I have no problem : the div appears ... but in mouseout, there is a bug with settimeout which says "ID is undefined" ...
Has someone has an idea (I could of course give the name inside the script of the ID of the DIV, but I want to have SEVERAL menus)