images resizing not working proper

images resizing not working proper

I have a lot of images on a page and the have to be a little bit larger, so i dont want to change all of the css.

I have made a couple of lines of code which doesn't give the right values back.

The images have all diffrent sizes.

  1. $('.imgbox').each(function(){

        var getX =  $(this).width();
        var getY =  $(this).height();
        var addX = 10;
        
        var xH = getY + addX;
        var xW = getX + addX;
                        
        $(this).children('img').css({width: xW + 'px', height: xH+ 'px'});    
    });












  2. <div class="imgbox">
       <img src="image_blabla.jpg" />
  3. </div>

there's probably some thing wrong because it gives me very big values back.