var theImage = new Image();
   var iurl = $("#eee").attr("src");
   var fk = 0,fg = 0;
theImage.onload=function(){
 fk = this.width;
      fg = this.height;
alert(fk+" "+fg);
};
   theImage.src = iurl;

解决方案 »

  1.   

    (document).ready(function(){
       var img = $('#eee');
       if(img[0].width){
           $("#aaa").html(img[0].width); 
       }else{
           img[0].onload = function(){
             $("#aaa").html(img[0].width);    
           }
       }
    });
      

  2.   


    var screenImage = $(this).find('img');
                    theImage.src = screenImage.attr("src");
                    var imageWidth = theImage.width;
                    var imageHeight = theImage.height;
      

  3.   

      $(document).ready(function () {
            var theImg = new Image();
            theImg.src = $("#aaa").attr("src");
            var ss = $("#aaa").attr("height");
            alert(theImg.width+"=="+theImg.height);
        });