jqueryexample.com jQuery Image Resize in aspect ratio Plugin - jqueryexample.com

jQuery Image Resize in aspect ratio Plugin by jqueryexample

If you are looking for resize image as per its parent block and it must maintain aspect ratio?

jquery plugin “Aspect Ratio”. It fit image to parent container

e.g. suppose i have an  <div> having ID as container. all the images

should be resized as per the width of the <div> and images should

maintain it’s aspect ration too.

  1. Add the jquery library to your page.
  2. Add the Dimensions plugin to the page – http://plugins.jquery.com/project/dimensions
  3. Finally, Add the Aspect Ratio plugin to the page.

To manipulate all images on a page w/ the AspectRatio plugin, simply type…

$(‘img’).AspectRatio();

 

Did you like this? Share it:

Discussion

  1. image resizer linked here

    [... If you are looking for resize image as per its parent block and it must maintain aspect ratio? jquery plugin "Aspect Ratio". It fit image to parent container e.g. suppose i have ...]

Leave a Comment