leo列

导航

2012年8月11日 #

取得图片的宽和高

摘要: 在WEB开发的实际过程中经常遇到加载入的图片,而有些操作需要知道这些加载进来的图片的宽和高,用JQUERY的$("img").height();或者$("img").width();并不是所有的浏览器都能取到,也试过javascript的function getImgProperty(elem,property){ var img = new Image(); img.src=elem.src; var w,h; w=img.width; h=img.height; return "width:"+w+"height:&qu 阅读全文

posted @ 2012-08-11 23:14 leo列 阅读(167) 评论(0) 推荐(0) 编辑