Can I use Jquery to automatically find and set the width and height of a variety of images?

Posted by Ryan on Stack Overflow See other posts from Stack Overflow or by Ryan
Published on 2011-03-08T23:42:36Z Indexed on 2011/03/09 0:10 UTC
Read the original article Hit count: 96

Filed under:
|
|

I am using the Masonry Plugin and for it to work correctly with images, you need to set the width and height within the image tag. All the image's heights will vary, but the width will be set at 200px.

Is there a way for Jquery to detect the height of each image and set it's height? That way I don't have to go set the height of every single image.

Does this make sense?

Hope someone can help! I am new to Jquery.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about height