A designer just gave me the HTML/JS/CSS for a new site design. The page is using the good old fashioned MM_crap methods to preload images.
Should we still be preloading mouseover images in today's world? It feels so 1998.
Preload lets you tell the browser about critical resources that you want to load as soon as possible, before they are discovered in HTML. This is especially useful for resources that are not easily discoverable, such as fonts included in stylesheets, background images, or resources loaded from a script.
The first step in creating a rollover is to tell JavaScript about the images the rollover will use. This will cause JavaScript to load the images into memory before they are visible. Once the images are cached, the image swaps can happen instantaneously.
Should we still be preloading mouseover images in today's world?
Yes, absolutely. Even on fast connections, DNS lookups or connection hiccups can create a notable delay when loading an image. You don't want that on a mouseover.
No need to use Dreamweaver's preload code though: See What is the best way to preload multiple images in JavaScript? for alternatives.
Plus, there is a very interesting alternative of course (as mentioned by @hd and @Marcel): CSS sprites. Depending on your situation, they can be a superior solution - if you're working on something new, it may well be worth the switch.
yes,why use preload mouseover images when we can use CSS sprites?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With