Click to See Complete Forum and Search --> : rollover menu not disappearing on-mouse out


redsand198
08-07-2003, 06:52 AM
hello-

my rollover menu's will not disappear on mouse out, i was wondering if anyone here could help me with my code

this is the div of one of the menu's


<DIV class=submenu1 id=submenu_1 style="background-color:#cccccc;" onmouseout="Hide('submenu_1')">
<table border="0" width="137" cellspacing="0" cellpadding="2" bgcolor="#cccccc">
<tr><td>
<a href="workcomp.html" class="hrefsubmenu"><b>Workers' Compensation</b></a><br>
<a href="avc.html" class="hrefsubmenu"><b>Property & Casualty Insurance</b></a><br>
<a href="avib.html" class="hrefsubmenu"><b>Employee Benefits</b></a><br>
<a href="risk.html" class="hrefsubmenu"><b>Risk Management</b></a><br>
<a href="safety.html" class="hrefsubmenu"><b>Safety & Loss Control</b></a><br>
</td></tr>
</table>
</div>


here is the complete URL:

http://antachmotorsports.com/avi/home.html

thank you for any help!

David Harrison
08-07-2003, 11:47 AM
Use this:

document.getElementById("submenu_1").style.display="none";

redsand198
08-07-2003, 01:10 PM
i tried that line of code here:


function Hide(obj) {
if(ie) {
if(event.srcElement.id==obj) {
document.getElementById("submenu_1").style.display="none";
}
}
}


as well as here (removing the code from above)


<DIV class=submenu1 id=submenu_1 style="background-color:#cccccc;" document.getElementById("submenu_1").style.display="none";>
<table border="0" width="137" cellspacing="0" cellpadding="2" bgcolor="#cccccc">
<tr><td>
<a href="workcomp.html" class="hrefsubmenu"><b>Workers' Compensation</b></a><br>
<a href="avc.html" class="hrefsubmenu"><b>Property & Casualty Insurance</b></a><br>
<a href="avib.html" class="hrefsubmenu"><b>Employee Benefits</b></a><br>
<a href="risk.html" class="hrefsubmenu"><b>Risk Management</b></a><br>
<a href="safety.html" class="hrefsubmenu"><b>Safety & Loss Control</b></a><br>
</td></tr>
</table>
</div>



and still neither work

is this script i'm using hopelesS?

thank you for your help!

David Harrison
08-08-2003, 01:34 PM
Can you just clear something up for me? What does this line do:

if(event.srcElement.id==obj) {

Because when you take it out your script works.

redsand198
08-11-2003, 07:40 AM
when i took that line out, the submenus never came up...

David Harrison
08-11-2003, 02:07 PM
Did you also take out the corresponding closing brace:

}

?

redsand198
08-11-2003, 02:27 PM
perfect, i'm an idiot


thank you so much for your help!

David Harrison
08-11-2003, 02:28 PM
Easy mistake to make, I do it all the time.

Happy to help. :)

Paul Jr
08-14-2003, 12:13 AM
Are the lines of text in the Roll Over Menu supposed to be links? From what I've seen, they are. But it is nearly impossible to get your mouse over to them. If you roll your mouse over the link, then the Menu pops up, and you move your mouse over to the Menu, as soon as your pointer touches the side of the Menu, it disappears. If you move fast enough, and you get lucky, you can get your pointer on one of the lines of text. But if you move it off, to anywhere else, the menu goes away. The text lines are active.

redsand198
08-14-2003, 08:09 AM
Originally posted by Paul Jr
Are the lines of text in the Roll Over Menu supposed to be links? From what I've seen, they are. But it is nearly impossible to get your mouse over to them. If you roll your mouse over the link, then the Menu pops up, and you move your mouse over to the Menu, as soon as your pointer touches the side of the Menu, it disappears. If you move fast enough, and you get lucky, you can get your pointer on one of the lines of text. But if you move it off, to anywhere else, the menu goes away. The text lines are active.



before i made the corrections in this thread, the submenu would never disappear if you went mouse-out. the corrections above got it to disappear on mouse-out, but like you said you have almost no time to click the links...

do you have any suggestions for how to fixthis? i'd appreciate it, thank you!