H
hoolie
I'm preloading images with the standard code:
default1 = new Image(); default1.src = "images/image1.gif";
changed1 = new Image(); changed1.src = "images/image1-on.gif";
default2 = new Image(); default2.src = "images/image2.gif";
changed2 = new Image(); changed2.src = "images/image2-on.gif";
And this is my rollover code:
var iName="";
function Ichange(p) {
var pSrc=eval(p+ ".src");
document[iName].src = pSrc;
}
But for some reason on the first mouseover it doesn't seem like the
image has been preloaded. There is a delay, like it's looking for the
rollover image, which should have already been preloaded. Anyone have
any ideas why?
Here is the inline code for a mouseover:
<a href="test.html" onMouseOver="iName='image1'; Ichange('changed1')"
onMouseOut="Ichange('default1')"><img src="images/image1.gif"
width="122" height="19" border="0" name="image1"></a>
Thanks for any help you can provide!
default1 = new Image(); default1.src = "images/image1.gif";
changed1 = new Image(); changed1.src = "images/image1-on.gif";
default2 = new Image(); default2.src = "images/image2.gif";
changed2 = new Image(); changed2.src = "images/image2-on.gif";
And this is my rollover code:
var iName="";
function Ichange(p) {
var pSrc=eval(p+ ".src");
document[iName].src = pSrc;
}
But for some reason on the first mouseover it doesn't seem like the
image has been preloaded. There is a delay, like it's looking for the
rollover image, which should have already been preloaded. Anyone have
any ideas why?
Here is the inline code for a mouseover:
<a href="test.html" onMouseOver="iName='image1'; Ichange('changed1')"
onMouseOut="Ichange('default1')"><img src="images/image1.gif"
width="122" height="19" border="0" name="image1"></a>
Thanks for any help you can provide!