var els = $('.address_wrapp');
els.each(function(index){
var el = els.eq(index);
var prevCont = el.closest('.squeeze_template');
if(prevCont.length < 1){ return false; } var map=prevCont.find('#map'); var fullwidth=prevCont.width(); var block=$('.address_wrapp').outerWidth(); var padding=block - $('.address_block').outerWidth(); var toffset=$('.address_block').offset().top - prevCont.offset().top; var blockheight=$('.address_block').outerHeight(); var fullheight=prevCont.height(); var allheight=fullheight + toffset; var allwidth=(fullwidth - block/2 - padding/2)*2; map.css('width',allwidth); map.css('height',allheight); window.setSizePresent=true; });