I’m trying to make a menu system.
[CODE]
<script>
function scrolldown(di,height,time){
var x;
var newtime;
var menu;
if(di == 1){ menu = “menu1”; }
newtime = time + 2;
x = 2*(newtime^2) – height;
var y;
y = parseInt(x);
if(height == 0){ x=5; }
if(x < 0)
{
document.getElementById(menu).style.top = x;
setTimeout(“scrolldown(“+di+”,”+height+”,”+newtime+”)”, 10);
}
else
{
document.getElementById(menu).style.top = 0;
}
}
function gone(di,height){
var menu;
if(di == 1){ menu = “menu1″; }
document.getElementById(menu).style.top = height;
}
</script>
<span id=”menu1″ onmouseover=”scrolldown(1,380,0);” onmouseout=”gone(1,-380);”>
Hello how are you doing?
</div>
My question is, while the menu is coming down (as it does properly with that script) how can I halt the script and make it disappear if it isn’t completely down and the user moves there mouse off the menu. The way it works now they have to have their mouse over it the entire time it drops then move it away for it to work properly.
Thanks
-Joe