Home » Labs » Preload Images Fastly With jQuery  

Preload Images Fastly With jQuery


Filed under Labs
function preloadImages(arrayOfImages) {
    $(arrayOfImages).each(function(){
        $('<img/>')[0].src = this;
    });
}
 
// Usage of code
 
preloadImages([
    'images/image01.jpg',
    'images/image02.jpg',
    'images/image03.jpg',
    'images/image04.jpg',
    'images/image05.jpg'
]);
It's only fair to share...Share on Google+Tweet about this on TwitterShare on Facebook
Tags:

Posts you may like: