A
Aaron
I'm having problems getting my popup menu to work correctly, and was
hoping someone here could point me in the right direction. I have the
following script:
<script>
var activeMenu="";
function getObject(id) {
var object=eval("document.getElementById('"+id+"')");
return object;
}
function PopMenu(M) {
clearTimeout();
HideActive();
getObject(M).style.visibility="visible";
activeMenu=M;
}
function HideActive() {
if (activeMenu !="") {
getObject(activeMenu).style.visibility="hidden";
activeMenu="";
}
}
function menuTimeout() {
setTimeout("HideActive()", 2000);
}
</script>
which goes with the following html:
<div id="menuhead" onMouseOver="PopMenu('menu')">
<img src="menuhead.gif" />
</div>
<div id="menu" onMouseOut="menuTimeout()">
<a href="test1.htm">Test 1</a>
<a href="test2.htm">Test 2</a>
<a href="test3.htm">Test 3</a>
</div>
The menu opens perfectly, but it closes 2 sec after I mouseOut() of
'menuhead' instead of the actual 'menu'. Also, if I repeatly
mouseOver() the 'menuhead', the timing gets thrown off, as if
clearTimeout() is being called irregularly. Could someone with more
experience give me a hand?
Thanks,
Aaron
hoping someone here could point me in the right direction. I have the
following script:
<script>
var activeMenu="";
function getObject(id) {
var object=eval("document.getElementById('"+id+"')");
return object;
}
function PopMenu(M) {
clearTimeout();
HideActive();
getObject(M).style.visibility="visible";
activeMenu=M;
}
function HideActive() {
if (activeMenu !="") {
getObject(activeMenu).style.visibility="hidden";
activeMenu="";
}
}
function menuTimeout() {
setTimeout("HideActive()", 2000);
}
</script>
which goes with the following html:
<div id="menuhead" onMouseOver="PopMenu('menu')">
<img src="menuhead.gif" />
</div>
<div id="menu" onMouseOut="menuTimeout()">
<a href="test1.htm">Test 1</a>
<a href="test2.htm">Test 2</a>
<a href="test3.htm">Test 3</a>
</div>
The menu opens perfectly, but it closes 2 sec after I mouseOut() of
'menuhead' instead of the actual 'menu'. Also, if I repeatly
mouseOver() the 'menuhead', the timing gets thrown off, as if
clearTimeout() is being called irregularly. Could someone with more
experience give me a hand?
Thanks,
Aaron