原理:页面加载完了,图片不一定加载完了。
$(function(){ $("img").on("load",function(){ //核心 var w = $(this).width(); alert(w); }); });