...

View Full Version : div disappear issue



bftwofreak
10-04-2008, 11:08 PM
I've got a div hide function below for my menu, but for some reason the menu won't disappear after the set time. It merely disappears on the mouseout.

var disappearTimer;
function menu_On(menu)
{
document.getElementById(menu).style.visibility="visible";
}
function menu_Off(menu)
{
disappearTimer = setTimeout(document.getElementById(menu).style.visibility='hidden', 1000);
}
function clear_Off()
{
clearTimeout( disappearTimer );
}
What's the issue?

vwphillips
10-04-2008, 11:21 PM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title></title>
<script language="JavaScript" type="text/javascript">
/*<![CDATA[*/
var disappearTimer;
function menu_On(menu)
{
document.getElementById(menu).style.visibility="visible";
}
function menu_Off(menu)
{
disappearTimer = setTimeout(function(){ document.getElementById(menu).style.visibility='hidden'; }, 1000);
}
function clear_Off()
{
clearTimeout( disappearTimer );
}
/*]]>*/
</script></head>

<body>
<BR><BR>
<BR><BR>
<input id="tst" type="button" name="" value="Test" onmouseout="menu_Off('tst');"/>
</body>

</html>

bftwofreak
10-08-2008, 03:53 AM
My latest problem with the same Timeout

var disappearTimer;

function menu_On(menu)
{
document.getElementById(menu).style.visibility="visible";
}

function menu_Hide()
{
document.getElementById('info').style.visibility="hidden";
document.getElementById('tick').style.visibility="hidden";
}

function menu_Off()
{
disappearTimer = setTimeout( menu_Hide() , 1000 );
}

function clear_Off(menu)
{
clearTimeout( disappearTimer );
}

vwphillips
10-08-2008, 12:42 PM
function menu_Off()
{
disappearTimer = setTimeout(function(){ menu_Hide() }, 1000 );
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum