获取img元素图片的实际尺寸

// Get on screen image
var screenImage = $("#image");

// Create new offscreen image to test
var theImage = new Image();
theImage.src = screenImage.attr("src");

// Get accurate measurements from that.
var imageWidth = theImage.width;
var imageHeight = theImage.height;

  

posted @ 2016-05-11 23:52  #天行健#  阅读(815)  评论(0编辑  收藏  举报