It's still not working and driving me crazy. Here's the code, as I'm new I wouldn't mind any helpful advice, criticism etc.
//cacheimg.js
HomeAlt = new Image();
HomeAlt.src = "images/Homeb_a.gif";
LinksAlt = new Image();
LinksAlt.src = "images/Linksb_a.gif";
DownloadsAlt = new Image();
DownloadsAlt.src = "images/Downloadsb_a.gif";
function on( image )
{
if( image == "home" )
Home.src = HomeAlt.src;
else if( image == "links" )
Links.src = LinksAlt.src;
else if( image == "downloads" )
Downloads.src = DownloadsAlt.src;
}
function off( image )
{
switch( image )
{
case "home": Home.src = "images/homeb.gif"; break;
case "links": Links.src = "images/linksb.gif"; break;
case "downloads": Downloads.src = "images/downloadsb.gif"; break;
}
}
By the way, as you've noticed I haven't gotten around to updating my off function which also happens to illustrate one of my questions. With opera, ie you can use strings in switch but netscape doesn't seem to recognise it. IS this correct?