getImgInfo获取图片宽高

var getImgInfo = function( img ){ 
  var fun = arguments.callee; 
  if( !img.width || !img.height ){
    var t = setTimeout( function(){
      fun.call( null , img );
    } , 10 );
  }else{    
    clearTimeout(t);
    return [img.width,img.height];
  }
}

 

posted on 2014-08-12 10:17  rainbow661314  阅读(173)  评论(0)    收藏  举报