title: jquery image width() is not returning correct value in IE9
body: <p>We have an image tag with width and height specified as auto so that we can get the width and height of the actual image. So we use the following to get them.</p>
  
  <pre><code>$("img.list-image").width()
  $("img.list-image").height()
  </code></pre>
  
  <p>in FF, Chrome, IE8 and safari, the width and height returned are 125 pixel and 160 pixel respectively and these values are correct. But in IE9, the width is 1519 pixels and the height is 771 pixels. For some reason, these width and height functions are not returning proper values in IE9. Any help is appreciated.</p>
  
  <p><strong>EDIT:</strong>
  Following is the code We are using</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
      &lt;title&gt;Image Page&lt;/title&gt;
      &lt;style type="text/css" &gt;
      .list-category-image
      {
          border-width: 0px;display:none;
      }
      &lt;/style&gt;
      &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
          //&lt;![CDATA[
  
          $(function() {
              categoryImageaspectratio();
          });
  
          function categoryImageaspectratio() {
              $("img.list-category-image").one('load', function() {
                  var width = 85.0, height = 85.0;
                  var realWidth, realHeight;
                  realWidth = $(this).width();   // Note: $(this).width() will not
                  realHeight = $(this).height();
  
                  //alert("width, height = (" + realWidth + "," + realHeight + ")");
  
                  // Now scale the image.
                  var aspectRatio = 1.0;
                  if (realHeight / height &gt; realWidth / width) {
                      aspectRatio = realHeight / height;
                      width = realWidth / aspectRatio;
                  }
                  else {
                      aspectRatio = realWidth / width;
                      height = realHeight / aspectRatio;
                      //alert("aspectRatio = " + aspectRatio);
                      //alert("height = " + height);
                  }
  
                  var imgWidth = parseInt(width) + "px";
                  var imgHeight = parseInt(height) + "px";
  
                  //alert(imgWidth + ", " + imgHeight);
  
                  //   $(this).css("width", imgWidth).css("heigth", imgHeight).css('display', 'block');
                  $(this).css("width", imgWidth).css("heigth", imgHeight).css('display', 'block').css('text-align', 'center').css('margin-left', 'auto').css('margin-right', 'auto');
              }).each(function() {
                  if (this.complete) {
                          $(this).load();
                  }
              });
          }
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
      &lt;div style="width:85px; height:85px;"&gt;
          &lt;img class="list-category-image" src="http://ecx.images-amazon.com/images/I/411j0fCdVKL._SL160_.jpg" alt="" /&gt;
      &lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>