jQuery plugin to preload images

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 […]

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

About The Author

Deepak Gupta is a IT & Web Consultant. He is the founder and CEO of diTii.com & DIT Technologies, where he's engaged in providing Technology Consultancy, Design and Development of Desktop, Web and Mobile applications using various tools and softwares. Sign-up for the Email for daily updates. Google+ Profile.