获取图片高度和宽度

来源:互联网 发布:淘宝下拉菜单 编辑:程序博客网 时间:2024/05/23 16:43
 
// Get on screen imagevar screenImage = $("#image");// Create new offscreen image to testvar theImage = new Image();theImage.src = screenImage.attr("src");// Get accurate measurements from that.var imageWidth = theImage.width;var imageHeight = theImage.height;

0 0
原创粉丝点击