JS图片加载时获取图片宽高信息
var height = 0; var img = new Image(); img.src = node.find("img[class='img1_1']").attr("src"); if (img.complete) { height = img.height; } else { img.onload = function () { height = img.height; } }
onerror
multiple
var height = 0; var img = new Image(); img.src = node.find("img[class='img1_1']").attr("src"); if (img.complete) { height = img.height; } else { img.onload = function () { height = img.height; } }
onerror
multiple