Home > Web Front-end > JS Tutorial > body text

Simple implementation of image preloading with javascript_javascript skills

WBOY
Release: 2016-05-16 16:29:05
Original
1341 people have browsed it

Simple image preloading
reloader.js

Copy code The code is as follows:

var images = new Array();

function preloadImages(){
for (i=0; i < preloadImages.arguments.length; i ){
images[i] = new Image();
images[i].src = preloadImages.arguments[i];
}
}
preloadImages("logo.jpg", "main_bg.jpg", "body_bg.jpg", "header_bg.jpg", "jser.jpg");

The specific usage is as above, friends can use your imagination and expand freely.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template