我正在处理预加载图片,我正在尝试加载1到40但它无效:(这是代码:
function preload(arrayOfImages){
$(arrayOfImages).each(function(){
(new Image()).src = this;
});
};preload(['/img/wallpapers/'images 1 to 40'.jpg']);
答案 0 :(得分:1)
function preload(arrayOfImages){
$(arrayOfImages).each(function(){
(new Image()).src = this;
});
for(i=1;i<=40;i++)
preload('/img/wallpapers/'images' + i + '.jpg');