I have a responsive layout with some images. The images have max-width:100%
set. And the height cannot be preset in the CSS or the HTML height
attribute, or else the image distorts as the responsive layout gets smaller. It has to be height: auto;
in order to scale properly.
Is it possible to calculate the height of the image in jQuery? .height()
and .css('height')
relies on the css or height attrib to be set, and like I said, I cannot set those without distorting the image when the responsive design changes size.