网站首页文章详情

js实现图片预加载方法

发布时间:2016-02-25 12:28编辑:胜男

function preload() {
    var images = new Array()
    for (i = 0; i < preload.arguments.length; i++) {
        images[i] = new Image()
        images[i].src = preload.arguments[i]
    }
}
preload('image/home1.png','image/home2.png','image/user1.png','image/user2.png');