Hi,I have a menu with a submenu that I want to hide after 5 seconds.The submenu is a string that I hide and show on mouseOver and mouseOut.In mouseOver:
var submenustring=""; for(i=0; i<AbsoluteArray[id-1].length; i++) { var x=document.getElementById('submenu').rows[0].cells; x[0].style.padding="0px 0px 0px "+px+"px"; submenustring = submenustring + AbsoluteArray[id-1][i]; if(i<AbsoluteArray[id-1].length-1) { submenustring = submenustring + " | "; } } x[0].innerHTML= submenustring; document.getElementById("submenu").style.visibility = "visible"; count();
In my count() function, I call the setTimeOut javascript function to hide my submenu after 5 seconds
function count(){ var t = 0; t=setTimeout('document.getElementById("submenu").style.visibility = "hidden"',5000); clearTimeout(t);}
The problem is that the "timer" doesn't start at 0 on eachmouse over so the submenu disapears before the 5 seconds is completed. I want to have a 5 seconds submenu on each mouse overThanks !