获取图片的宽和高

var i = new Image;
i.onload = function(){
  console.log('success,width:%i,height:%i', this.width, this.height);
}
i.onerror = function(){
  console.log('fail');
}
i.src = 'http://m327.mail.qq.com/zh_CN/htmledition/images/logo/logo_min_0.gif';
//i.src = 'error';

  

posted @ 2012-02-29 19:07  Arliang  阅读(178)  评论(0编辑  收藏  举报