开发者

Scale two images proportionally in jQuery [closed]

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜