Click to See Complete Forum and Search --> : stop event?


qbproger
12-10-2003, 12:28 PM
I'm trying to make a menu system.


<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

qbproger
12-11-2003, 11:53 AM
from the lack of responce, maybe i'm going about doing it wrong? I want a menu that comes down and as it comes down it speeds up. The problem as stated before is that if they move their mouse away before it is completely open it doesn't disappear.

can you use something like this:

document.getElementById(di).event.onmouseover

or something like that? I think i vaguely remember seeing something like that.