Click to See Complete Forum and Search --> : need quick help with menu!


virva
05-02-2003, 02:45 AM
Hi everybody! Could you help a newbie...?

I have a js menu that appears with onMouseOver. I would it like to disappear after 5 seconds, but I am not sure how to do it. This is the code I have right now (I call the function in other part of my page):

--

var refer = true;
var howLong = 5000;

function combo() {
if (refer = true) {

document.all.contents.style.visibility="visible";
refer = false;

if (refer = false){

t = null;
//var howLong = 5000;
t = setTimeout(document.all.contents.style.visibility="hidden", howLong);
refer = true;
}
}
}

--

Any help appreciated - preferably asap. Thank you! :)

gil davis
05-02-2003, 07:40 AM
If you need to use setTimeout it is always easier to make it call a function. That way you don't have to deal with quote problems.function combo() {
...
t = setTimeout("hideIt()", howLong);
...
}

function hideIt() {
document.all.contents.style.visibility = "hidden";
}