jQuery Image Scale

Download

Uncompressed: imgscale.jquery.js

Compressed: imgscale.jquery.min.js


Demo

The full size of this image is really 1024 x 768



HTML <div class="non-immediate-parent-container">
  <a href="http://imgscale.kjmeath.com/pokemon.jpg" class="field-anchor">
    <img width="1024" height="768" class="pokemon" alt="" src="http://imgscale.kjmeath.com/pokemon.jpg" />
  </a>
</div>

CSS .non-immediate-parent-container{
  height: 200px;
  width: 300px;
}

JavaScript $(document).ready(function(){
  $('img.pokemon').imgscale({
    parent : '.non-immediate-parent-container',
    fade : 1000
  });
});
Description Automatically scales images to fit or fill their parent container.
Notes The defined parent container of the image must have a defined height and width in CSS.
Basic usage $('img').imgscale();
Parameters parent scale center fade