为什么用size()出现下面的问题
demo4.html?_ijt=mee8ikld552icj1ci69dao95k0:111 Uncaught TypeError: $(...).size is not a function
at Image.oImg.onload
我的代码:
$(document).ready(function(){
var num = 0;
$('img').each(function (i) {
var oImg = new Image();
oImg.onload = function () {
oImg.onload = null;
num++;
$(".loading b").html(num/$('img').size() * 100) + "%";
if(num >= i){
$(".loading").fadeOut();
}
}
oImg.src = $('img')[i].src;
});
});