Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DHTML Drop-down problems

Status
Not open for further replies.

sevex

Programmer
Sep 18, 2001
74
CA
I'm making a dhtml drop down menu, and while it works flawlessly in IE, it's giving me trouble in Netscape (go figure). The problem is if I move off of the image that makes the drop down appear, and onto the drop-down itself, it dissapears. I have onmouseover and onmouse events on both the link, and the drop-down, but netscape doesn't process the ones in the drop-down. below is an example of my code. Any help would be fantastic, I'm about to tear out my hair over this.

<script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;>
var NN4 = document.layers? true : false;
var IE4 = document.all? true : false;

function show(layer) {
if (NN4) {
document.layers[layer].visibility = &quot;show&quot;;
} else {
document.all[layer].style.visibility = &quot;visible&quot;;
}
}

function hide(layer) {
if (NN4) {
document.layers[layer].visibility = &quot;hidden&quot;;
} else {
document.all[layer].style.visibility = &quot;hidden&quot;;
}
}
</script>

// first link
<a href=&quot;#&quot; onMouseOver=&quot;show('menu1');&quot; onMouseOut=&quot;hide('menu1');&quot;><img src=&quot;../images/s_pullnav_veg.gif&quot; width=&quot;185&quot; height=&quot;21&quot; border=&quot;0&quot;></a>

// first drop down
<span id=&quot;menu1&quot; style=&quot;visibility:hidden; position:absolute; top:197; left:268; z-index:50&quot; onMouseOver=&quot;show('menu1');&quot; onMouseOut=&quot;hide('menu1');&quot;>
** drop down text **
</span>
 
When you mouse over does the text: ** drop down text ** appear?? If so, then it works for me in both IE (ver 6) and NS (ver 4.75)...
What NS did you try in?? Try to type in &quot;Javascript:&quot; in the URL bar to use the NS javascript consule, this will help narrow out why the script might not work... I have not failed; I merely found 100,000 different ways of not succeding...
 
I'm testing in NS 4.08. Maybe no one even uses that one anymore... The *** drop down text *** appears when I mouseover the image, but when I move down to the text, where links will be eventually, it dissapears, cause the mouse events in the span tag seem to be ignored.
 
Ahhh, I see your problem...sorry mate can't help ya, maybe you call out to xutopia or wullie for help... I have not failed; I merely found 100,000 different ways of not succeding...
 
thanks anyway... I'll just keep hacking away at it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top