javascript image resize doesn't work in ie8
<p>My company's new web layout depends on an image being 150px wide. The previous design required the images to be 125px tall. So all the images have different widths based on their width/height ratio. I put some javascript together to resize the images to fit in their space until our interns get around to sizing the images in photoshop. My temporary solution seems to work fine in everything but ie8, including ie6 of all things! Here's the code. </p>

<pre><code>$('div.item &gt; div.left &gt; a &gt; img').load(function(){
    var img = $(this);
    img.each(function(){
        var width = img.width();
        var height = 125;
        var ratio = width/height;
        if(width &gt; 150){
            var newWidth = 150;
            var newHeight = newWidth/ratio;
            img.attr({width:newWidth, height:newHeight});
        }
    });
});
</code></pre>

<p>Any thoughts are greatly appreciated </p>
