Scale two images proportionally in jQuery [closed]
Want to improve this question? Update the question so it focuses on 开发者_开发百科one problem only by editing this post.
Closed 4 years ago.
Improve this questionI have two images in html. I need to scale the images proportionally using jQuery. On scaling two images, resize should be taken place.
If with "proportionally" you mean that each of the two images should keep the original aspect ratio (i.e 16:9 or 4:3), setting just the width (or height) of an image, and leaving blank the other dimension, will resize the image proportionally ...
$("img").css({width:100px, height:auto});
or
$("img").css({width:auto, height:75px});
精彩评论