开发者

How to increase height and width of an image in jquery up to a certain limit?

I have two images and those are layered on each other using z-index. I want to increase their height and width by 20 from their current height and width whenever a button is clicked. I have assigned height and width to one image using a css class and for another image using style property in <img> tag.

Friends! I increased the height and width of one image by setting its height and 开发者_StackOverflow社区width. But this is achieved by hard coding so it works only one time i.e. when button is clicked first time.

Question 1. How can I increase the height and width of both images at the same time from their current height and width?

Please guide me friends!


Have you tried width and height functions:

var img = $('#imgid');
img.width(img.width() + 20);
img.height(img.height() + 50);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜