Welcome to WmW, PacoGlen.
You'd have to use a Java applet, and even then you probably could not use a GIF, but would have to do an on-the-fly PAINT of the screen on mouseover, with the data file already preloaded with the Java applet, with all the bitmap (pixel) info in that data file for the new image. That's the only way I can think of to avoid loading the image on mouseover.
The actual PAINT in the Java applet would be fast enough, but the overhead for getting the applet downloaded and set up in the first place would be intolerable.
Yeah but that is what i already tried.
I think Everyman has spot the problem... it's a Browser restriction and no script will fix that.
I'll just find another way to get the thing running well.
Thanks for your help guyz !
or just use flash...lot simpler and a lot smaller ;)
Yeah but no transparency under Netscape :-(
If you slice the part of the background out of your page (if it's a pattern, if it's a color that's a no brainer)and then import it into the Flash movie as the background you can create the effect of transparency.
I've even seen MM extensions that control Flash movies using js. Go to MM Exchange.
Welcome Pacoglen... must say I haven't tried what you want to do, so I'm afraid I can't be of much help.
I've thought of using animated gifs for mouseovers before though, and I'd like to say "Thanks" for saving me time & frustration in the future! ;)
It start playing it as soon as its loaded even if it's hidden.
Because it was something that had to be put on many website, i couldn't use flash and fake transparency by copying the background.
There was just too many.
So i just didn't preload the gif because anyway it wasn't very big (5k).
Hmmmf. Darn web browsers never do what you want. :) Imagine, they are merrily consuming resources playing an animated gif that you can't even see. I suppose they are playing animated gifs that are off the screen, too. Oh well.
The challenge is the fact that you only want one loop on the animation. I've used onMouseover to switch from a static image to an animated gif. It works very well, but only for infinitely looping GIFs, as this thread uncovered.
The biggest challenge I found was that MSIE plays animations at different speeds from Netscape.