Image Displays Incorrectly On All Versions Of Internet Explorer
<p>I have the following Javascript code that resizes images on a page:</p>

<pre><code>    var max_size = 498;
    $(".slideimage").each(function(i) {
      if ($(this).height() &gt; $(this).width()) {
        var h = max_size;
        var w = Math.ceil($(this).width() / $(this).height() * max_size);
      } else {
        var w = max_size;
        var h = Math.ceil($(this).height() / $(this).width() * max_size);
      }
      $(this).css({ height: h, width: w });
    });
</code></pre>

<p>This code is contained within a $(document).ready() function.</p>

<p>The images display fine when viewed in Chrome, Firefox, Safari and Opera. However, when the same page is viewed in Internet Explorer 7, 8 and 9, sometimes (well, 50% of the time) when the page is first loaded the image appears at the correct width, but the height is really really small. I would guesstimate the height to be around 100px high. But when the page is reloaded, the same image will display perfectly.</p>

<p>It's a strange issue, and only happens in IE. Do I need to add or remove anything in that code?</p>

<p>Cheers</p>
