tags:

views:

20

answers:

2

Ok, i have a big image with a tab included

I like to load the whole div with the whole image, then resize the div just to show the tab, then when the tab click expand the div to the size of image (different on each div)

So getting the size of the image in the div click is the problem... $(this) the div, but how to get th image inside

Thanks in advance


i have found something like that

$('img', this).attr('height');

mabe that can work ?

+1  A: 
$(this).find('img');
Matchu
A: 
function get_img_dims(jquery_div) {
    height = $('img', jquery_div).attr('height');
    width = $('img', jquery_div).attr('width');
    jquery_div.attr({"width": width, "height": height });

}
Sean Vieira