June 21, 2008
4:39 am

Scott Jehl over at Filament Group wrote a jQuery plugin that automatically preloads all images from any directory specified in the CSS. The script iterates through each rule in each stylesheet attached to the current page and if the rule's value contains an image URL, it loads the image, thus ensuring it's available in the cache when used in the document.

To use it, just download the jQuery js code and run $.preloadCssImages(); when the DOM is ready. Don't forget that you'll also need to reference the jQuery javascript library in your page.

More info....

Source:→ Ajaxian

Loading

Contextual Related Posts:

1 Response | RSS comments on this post | Leave a comment»

  1. 1
    jQuery says#1 | April 6th, 2009 at 11:28 pm

    This is a very nice script and usefull as well. Thanks for sharing with us.

    But if you want to preload specific images, for example, using their url and insert them later into the DOM tree then you will find this article on preloading images with jQuery very useful.

No Pingback yet

PingBack URI

Leave a Response

Comment Preview
« Magic Toolbox “Magic Zoom, Magic Magnify, and Magic Thumb”, high-quality JavaScript image effectsGoogle Trends for Websites, show, compare traffic stats »
Feed Icon

Subscribe via RSS or email: