Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should we still preload mouseover images?

Tags:

html

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.

like image 757
Jeff Handley Avatar asked May 29 '11 07:05

Jeff Handley


People also ask

Why preload images?

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.

How do you load rollover images into memory for more efficiency?

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.


2 Answers

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.

like image 96
Pekka Avatar answered Oct 27 '22 01:10

Pekka


yes,why use preload mouseover images when we can use CSS sprites?

like image 26
hd. Avatar answered Oct 27 '22 00:10

hd.