SpydermanLA
07-19-2002, 04:44 AM
I'm trying to dynamically set the content of a submenu. To start off with, the layer is hidden, and then set to 'visible' when the user rolls over the main navigation item. The script works great in IE, but (surprise, surprise) goes all to hell in Netscape. Here is the script I'm using:
<div id="entContent" style="position: absolute; visibility: visible; z-index: 60;">
<script language="JavaScript">
if(project!='hbo'){
document.write('<a href="portfolio.html?hbo&3"><div class="menuitems">HBO Films</div></a>')
} else {
document.write('<div class="menuitemsNull"><img src="../images/checkmark.gif" width="16" height="12" border="0"> HBO Films</div>')
}
}
</script>
Netscape apparently doesn't run the script until the layer is made visible (that's fine). It also runs the script every time the layer visibility is toggled (also fine). The problem is when it *does* run the script, it rewrites the entire page, so suddenly all you see is the content of that one line (not fine!).
Can anybody offer an explanation and (hopefully) a solution?
Thanks,
Spyderman
<div id="entContent" style="position: absolute; visibility: visible; z-index: 60;">
<script language="JavaScript">
if(project!='hbo'){
document.write('<a href="portfolio.html?hbo&3"><div class="menuitems">HBO Films</div></a>')
} else {
document.write('<div class="menuitemsNull"><img src="../images/checkmark.gif" width="16" height="12" border="0"> HBO Films</div>')
}
}
</script>
Netscape apparently doesn't run the script until the layer is made visible (that's fine). It also runs the script every time the layer visibility is toggled (also fine). The problem is when it *does* run the script, it rewrites the entire page, so suddenly all you see is the content of that one line (not fine!).
Can anybody offer an explanation and (hopefully) a solution?
Thanks,
Spyderman