Answers for "jquery preload images"

0

jquery preload images

//preloading Images with jQuery
function preloadImages(images) {
    $(images).each(function(){
        $('<img/>')[0].src = this;
    });
}

preloadImages([
    'images/image1.png',
    'images/image2.png'
]);
Posted by: Guest on July-31-2019
0

jquery preload images

// Image proeloading with jQuery
$.fn.preload = function() {
    this.each(function(){
        $('<img/>')[0].src = this;
    });
}

// Usage:

$(['img1.jpg','img2.jpg','img3.jpg']).preload();
Posted by: Guest on October-17-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language