Reputation: 5875
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 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!
Upvotes: 0
Views: 281
Reputation: 1039588
Have you tried width and height functions:
var img = $('#imgid');
img.width(img.width() + 20);
img.height(img.height() + 50);
Upvotes: 1