Forum Moderators: open
here's the Javascript:
var mold;
function ShowSubNav(primaryNav)
{
if(!(mold == null))
{
mold.style.display = "none";
//alert("null");
}
if(document.getElementById)
{
var translation = primaryNav.replace("pri", "sub");
mold = document.getElementById(translation);
mold.style.display = "block";
}
}
function HideSubNav(subBar)
{
if(document.getElementById)
{
mold.style.display = "none";
}
}
It works fine in Firefox 1.0.3, also works in IE7, but sometimes(?) displays the "page loaded with errors" icon at the bottom, but throws 'mold.style' is null or not an object in IE6. It also breaks my a:hover CSS style on the first element in IE6.
This has to be my sloppy code, but I can't seem to figure it out.
var mold;
function ShowSubNav(primaryNav)
{
if(document.getElementById)
{
if(!(mold == null))
{
mold.style.display = "none";
//alert("null");
}
var translation = primaryNav.replace("pri", "sub");
mold = document.getElementById(translation);
mold.style.display = "block";
}
}
function HideSubNav(subBar)
{
if(document.getElementById)
{
mold.style.display = "none";
}
}