开发者

Scale two images proportionally in jQuery [closed]

开发者 https://www.devze.com 2023-03-16 01:22 出处:网络
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on 开发者_开发百科one problem only by
Closed. This question needs to be more focused. It is not currently accepting answers.

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 question

I 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});
0

精彩评论

暂无评论...
验证码 换一张
取 消