I am trying to preload images for a page and then use mouseover, etc. events to switch between the images. Everything seems to work as expected except my browser still goes out to the web to get what I had hoped were preloaded images. I have checked several posting areas and references and believe that I am doing this correctly. Also the code is similar to what I have used in the past. I don't know whether the problem is in the code, the browser setup or what. A simplified sample of what I am trying to do is presented below. The code exhibits the same problems I discribed above when loaded on my site.
<!doctype html PUBLIC "-//W3C//DTD html 4.01 transitional//EN">
<html>
<head>
<title>Image Save Test</title>
<SCRIPT LANGUAGE="javascript">
var testimage1=new Image(180,17);
testimage1.src = "PollingAreaYellow.gif";
var testimage2=new Image(180,17);
testimage2.src = "PollingAreaBlue.gif";
function LoadImage1()
{
document.images["AddressBook"].src=testimage1.src;
}
function LoadImage2()
{
document.images["AddressBook"].src=testimage2.src;
}
</SCRIPT>
</head>
<body>
<A HREF="AddressBook/AddressBook.cgi" TARGET="_top"
onClick=""
onMouseOver="LoadImage1()"
onMouseOut="LoadImage2()">
<IMG SRC="BaseDirImages/AddressBookBlue.gif" WIDTH="180" HEIGHT="17" BORDER="0" ALT="" NAME="AddressBook"></A>
</body>
</html>
Any suggestions?
Thanks
Andy Cruce
<!doctype html PUBLIC "-//W3C//DTD html 4.01 transitional//EN">
<html>
<head>
<title>Image Save Test</title>
<SCRIPT LANGUAGE="javascript">
var testimage1=new Image(180,17);
testimage1.src = "PollingAreaYellow.gif";
var testimage2=new Image(180,17);
testimage2.src = "PollingAreaBlue.gif";
function LoadImage1()
{
document.images["AddressBook"].src=testimage1.src;
}
function LoadImage2()
{
document.images["AddressBook"].src=testimage2.src;
}
</SCRIPT>
</head>
<body>
<A HREF="AddressBook/AddressBook.cgi" TARGET="_top"
onClick=""
onMouseOver="LoadImage1()"
onMouseOut="LoadImage2()">
<IMG SRC="BaseDirImages/AddressBookBlue.gif" WIDTH="180" HEIGHT="17" BORDER="0" ALT="" NAME="AddressBook"></A>
</body>
</html>
Any suggestions?
Thanks
Andy Cruce