Image resize with jquery
<p>need jquery image resize, like if image width > 400 then use resize width:50%, other images that is smaller size like 100X100 dont need to be resized. </p>

<p>I use this code</p>

<pre><code>var max_size = 400;
$(".comment p.message a.fancy img").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>But this code dont check smaller images. </p>
