newImgs.onload沒有執(zhí)行到,為什么呢?關(guān)于arr的圖片鏈接就不po進(jìn)來了 function preLoadingImg(arr){ for (var i = 0; i < len; i++) { var newImgs = new Image(); newImgs.onload = function{ progress.innerHTML = Math.round((count+1) / len * 100 + '%'); if(count >= len - 1){ loading.style.display = "none"; document.title = "1/" + len; } count++; }; newImgs.src = arr[i]; } } preLoadingImg(imgs);
圖片預(yù)加載,Image的onload沒有執(zhí)行
慕粉2124514671
2017-10-15 15:22:09