Home › Forums › JavaScript › Jquery preload images › Re: Jquery preload images
March 21, 2013 at 8:29 pm
#129289
Participant
Add the following code to your documen.ready,
var preloads = [
‘/wp-content/upl/images/logo.png’,
‘/wp-content/upl/images/logo2.png’,
‘/wp-content/upl/images/logo4.png’
];
$(preloads).each(function(){
$(‘‘)[0].src = this;
});
You just continue to add image paths to the array to preload them.