sue_hernandez
07-25-2005, 07:36 PM
I have what I think should be a very simple question for Netscape 4.79. I am simply tring to switch an image source from one image to another. IE works fine, but I can't seem to find code samples after browsing through Google.
My code is as follows:
var ns4=(document.layers)?true:false;
function HideContent()
{
if(ns4)
{
document.layers["imgContent"].src = "images/nav1.gif";
document.layers["imgContentButton"].src = "images/nav2-over.gif";
document.layers["imgHome"].src = "images/nav_home.gif";
}
else
{
if(document.getElementById)
{
document.getElementById("imgContent").src = "images/nav1.gif";
document.getElementById("imgContentButton").src = "images/nav2-over.gif";
document.getElementById("imgHome").src = "images/nav_home.gif";
}
}
}
I know I've searched for this before, I don't know why I can't find it now. The problem seems to be accessing the image element, although I've tried to put style="position: relative" and that didn't help any. Should I just put div's around every one of the images and hide/show that way? Yuck.
Any tips would be greatly appreciated.
Thanks
Sue
My code is as follows:
var ns4=(document.layers)?true:false;
function HideContent()
{
if(ns4)
{
document.layers["imgContent"].src = "images/nav1.gif";
document.layers["imgContentButton"].src = "images/nav2-over.gif";
document.layers["imgHome"].src = "images/nav_home.gif";
}
else
{
if(document.getElementById)
{
document.getElementById("imgContent").src = "images/nav1.gif";
document.getElementById("imgContentButton").src = "images/nav2-over.gif";
document.getElementById("imgHome").src = "images/nav_home.gif";
}
}
}
I know I've searched for this before, I don't know why I can't find it now. The problem seems to be accessing the image element, although I've tried to put style="position: relative" and that didn't help any. Should I just put div's around every one of the images and hide/show that way? Yuck.
Any tips would be greatly appreciated.
Thanks
Sue