JQuery Script to Automatically Preload images
filamentgroup.com
filamentgroup.com
The Filament Group blog is filled with gems like this, highly recommended reading. FWIW, Filament Group contribute heavily to jqUI, and developed Themeroller.
This is this big issue with responsive web design. There is a solution, but it requires both modifying HTML and additional HTTP requests:
The problem is that I can't ask Joe Client to create placeholder divs. I want to handle it magically for him.
edit: looked at page code.
Isn't that nearly the same as placeholders though? You're asking them to suffix their images, and add a non-standard attribute to every one they want to load dynamically. That burden, and the image resizing, is all done by Joe Client via that framework, under identical assumptions. That's not magical, and it's functionally identical to what I proposed, but it causes extra requests.
Just as your placeholder could happen in post processing, so could the suffix and attribute be added.
Having looked into this more there seem to be only three decent approaches. 1) Send the small image first potentially causing extra HTTP requests. 2) Require JS to make a placeholder swap. 3) Cap the image dimensions server side based on a User Agent/Resolution table.
Option 3 is terrible to implement but avoids the downsides the others have.
(Ready = DOM is ready, load = page elements are loaded)
--edit--
Oh, it just loaded. It looks like it's meant to preload CSS images, which makes more sense.