-
body onLoad
Hi,
I've got a problem with a page that has some rollover images that are pre-loaded. I load both the default image and the rollover images into variables / objects (whatever) in a function called init()
Now, on my page,
<body onload=init();>
to fire off the init routine.
If however, you leave your mouse over the image or quickly move it to another one before the whole page has loaded up, I get a javascript error saying that the object is not loaded.
Is there a standard way to get around this problem ?
ta
Andy
-
first of all, don't preload it with a function,
just preload then in the fist line of your page,!!
the onLoad event fire when all images on a page are finish loaded!
-
Hi,
thanks for the reply. I think I actually need to do a couple of calls, one to load the initial images and the second fired by onLoad to set the defaults for the images once they're loaded. Makes sense to me anyhow !
thanks for your help
cheers
Andy