$(window).load(function() { $(".automatic-img_01").each(function(){ $img = $(this).find("img"); $w = $img.width(); $h = $img.height(); $bw= $(this).width(); $bh= $(this).height(); b1 = $w/$h; b2 = $bw/$bh; if(b1>b2){ $img.css("height","100%") $wed = $bh*b1; $img.css("width",$wed+"px") fz =($(".automatic-img_01").width()-$wed)/2; $img.css("margin-left",fz+"px") }else{ $img.css("width","100%") $hed = $bw/b1; $img.css("height",$hed+"px") fs =($(".automatic-img_01").height()-$hed)/2; $img.css("margin-top",fs+"px") } }); }); $(window).load(function() { $(".automatic-img_02").each(function(){ $img = $(this).find("img"); $w = $img.width(); $h = $img.height(); $bw= $(this).width(); $bh= $(this).height(); b1 = $w/$h; b2 = $bw/$bh; if(b1>b2){ $img.css("height","100%") $wed = $bh*b1; $img.css("width",$wed+"px") fz =($(".automatic-img_02").width()-$wed)/2; $img.css("margin-left",fz+"px") }else{ $img.css("width","100%") $hed = $bw/b1; $img.css("height",$hed+"px") fs =($(".automatic-img_02").height()-$hed)/2; $img.css("margin-top",fs+"px") } }); }); $(window).load(function() { $(".automatic-img_03").each(function(){ $img = $(this).find("img"); $w = $img.width(); $h = $img.height(); $bw= $(this).width(); $bh= $(this).height(); b1 = $w/$h; b2 = $bw/$bh; if(b1>b2){ $img.css("height","100%") $wed = $bh*b1; $img.css("width",$wed+"px") fz =($(".automatic-img_03").width()-$wed)/2; $img.css("margin-left",fz+"px") }else{ $img.css("width","100%") $hed = $bw/b1; $img.css("height",$hed+"px") fs =($(".automatic-img_03").height()-$hed)/2; $img.css("margin-top",fs+"px") } }); }); $(window).load(function() { $(".automatic-img_04").each(function(){ $img = $(this).find("img"); $w = $img.width(); $h = $img.height(); $bw= $(this).width(); $bh= $(this).height(); b1 = $w/$h; b2 = $bw/$bh; observer:true; observeparents:true; if(b1>b2){ $img.css("height","100%") $wed = $bh*b1; $img.css("width",$wed+"px") fz =($(".automatic-img_04").width()-$wed)/2; $img.css("margin-left",fz+"px") }else{ $img.css("width","100%") $hed = $bw/b1; $img.css("height",$hed+"px") fs =($(".automatic-img_04").height()-$hed)/2; $img.css("margin-top",fs+"px") } }); }); $(window).load(function() { $(".automatic-img_05").each(function(){ $img = $(this).find("img"); $w = $img.width(); $h = $img.height(); $bw= $(this).width(); $bh= $(this).height(); b1 = $w/$h; b2 = $bw/$bh; if(b1>b2){ $img.css("height","100%") $wed = $bh*b1; $img.css("width",$wed+"px") fz =($(".automatic-img_05").width()-$wed)/2; $img.css("margin-left",fz+"px") }else{ $img.css("width","100%") $hed = $bw/b1; $img.css("height",$hed+"px") fs =($(".automatic-img_05").height()-$hed)/2; $img.css("margin-top",fs+"px") } }); }); $(window).load(function() { $(".automatic-img_06").each(function(){ $img = $(this).find("img"); $w = $img.width(); $h = $img.height(); $bw= $(this).width(); $bh= $(this).height(); b1 = $w/$h; b2 = $bw/$bh; if(b1>b2){ $img.css("height","100%") $wed = $bh*b1; $img.css("width",$wed+"px") fz =($(".automatic-img_06").width()-$wed)/2; $img.css("margin-left",fz+"px") }else{ $img.css("width","100%") $hed = $bw/b1; $img.css("height",$hed+"px") fs =($(".automatic-img_06").height()-$hed)/2; $img.css("margin-top",fs+"px") } }); }); $(window).load(function() { $(".automatic-img_07").each(function(){ $img = $(this).find("img"); $w = $img.width(); $h = $img.height(); $bw= $(this).width(); $bh= $(this).height(); b1 = $w/$h; b2 = $bw/$bh; if(b1>b2){ $img.css("height","100%") $wed = $bh*b1; $img.css("width",$wed+"px") fz =($(".automatic-img_07").width()-$wed)/2; $img.css("margin-left",fz+"px") }else{ $img.css("width","100%") $hed = $bw/b1; $img.css("height",$hed+"px") fs =($(".automatic-img_07").height()-$hed)/2; $img.css("margin-top",fs+"px") } }); }); $(window).load(function() { $(".automatic-img_08").each(function(){ $img = $(this).find("img"); $w = $img.width(); $h = $img.height(); $bw= $(this).width(); $bh= $(this).height(); b1 = $w/$h; b2 = $bw/$bh; if(b1>b2){ $img.css("height","100%") $wed = $bh*b1; $img.css("width",$wed+"px") fz =($(".automatic-img_08").width()-$wed)/2; $img.css("margin-left",fz+"px") }else{ $img.css("width","100%") $hed = $bw/b1; $img.css("height",$hed+"px") fs =($(".automatic-img_08").height()-$hed)/2; $img.css("margin-top",fs+"px") } }); }); $(window).load(function() { $(".automatic-img_09").each(function(){ $img = $(this).find("img"); $w = $img.width(); $h = $img.height(); $bw= $(this).width(); $bh= $(this).height(); b1 = $w/$h; b2 = $bw/$bh; if(b1>b2){ $img.css("height","100%") $wed = $bh*b1; $img.css("width",$wed+"px") fz =($(".automatic-img_09").width()-$wed)/2; $img.css("margin-left",fz+"px") }else{ $img.css("width","100%") $hed = $bw/b1; $img.css("height",$hed+"px") fs =($(".automatic-img_09").height()-$hed)/2; $img.css("margin-top",fs+"px") } }); }); $(window).load(function() { $(".automatic-img_10").each(function(){ $img = $(this).find("img"); $w = $img.width(); $h = $img.height(); $bw= $(this).width(); $bh= $(this).height(); b1 = $w/$h; b2 = $bw/$bh; if(b1>b2){ $img.css("height","100%") $wed = $bh*b1; $img.css("width",$wed+"px") fz =($(".automatic-img_10").width()-$wed)/2; $img.css("margin-left",fz+"px") }else{ $img.css("width","100%") $hed = $bw/b1; $img.css("height",$hed+"px") fs =($(".automatic-img_10").height()-$hed)/2; $img.css("margin-top",fs+"px") } }); }); $(window).load(function() { $(".automatic-img_11").each(function(){ $img = $(this).find("img"); $w = $img.width(); $h = $img.height(); $bw= $(this).width(); $bh= $(this).height(); b1 = $w/$h; b2 = $bw/$bh; if(b1>b2){ $img.css("height","100%") $wed = $bh*b1; $img.css("width",$wed+"px") fz =($(".automatic-img_11").width()-$wed)/2; $img.css("margin-left",fz+"px") }else{ $img.css("width","100%") $hed = $bw/b1; $img.css("height",$hed+"px") fs =($(".automatic-img_11").height()-$hed)/2; $img.css("margin-top",fs+"px") } }); }); $(window).load(function() { $(".automatic-img_12").each(function(){ $img = $(this).find("img"); $w = $img.width(); $h = $img.height(); $bw= $(this).width(); $bh= $(this).height(); b1 = $w/$h; b2 = $bw/$bh; if(b1>b2){ $img.css("height","100%") $wed = $bh*b1; $img.css("width",$wed+"px") fz =($(".automatic-img_12").width()-$wed)/2; $img.css("margin-left",fz+"px") }else{ $img.css("width","100%") $hed = $bw/b1; $img.css("height",$hed+"px") fs =($(".automatic-img_12").height()-$hed)/2; $img.css("margin-top",fs+"px") } }); }); $(window).load(function() { $(".automatic-img_13").each(function(){ $img = $(this).find("img"); $w = $img.width(); $h = $img.height(); $bw= $(this).width(); $bh= $(this).height(); b1 = $w/$h; b2 = $bw/$bh; if(b1>b2){ $img.css("height","100%") $wed = $bh*b1; $img.css("width",$wed+"px") fz =($(".automatic-img_13").width()-$wed)/2; $img.css("margin-left",fz+"px") }else{ $img.css("width","100%") $hed = $bw/b1; $img.css("height",$hed+"px") fs =($(".automatic-img_13").height()-$hed)/2; $img.css("margin-top",fs+"px") } }); }); $(window).load(function() { $(".automatic-img_14").each(function(){ $img = $(this).find("img"); $w = $img.width(); $h = $img.height(); $bw= $(this).width(); $bh= $(this).height(); b1 = $w/$h; b2 = $bw/$bh; if(b1>b2){ $img.css("height","100%") $wed = $bh*b1; $img.css("width",$wed+"px") fz =($(".automatic-img_14").width()-$wed)/2; $img.css("margin-left",fz+"px") }else{ $img.css("width","100%") $hed = $bw/b1; $img.css("height",$hed+"px") fs =($(".automatic-img_14").height()-$hed)/2; $img.css("margin-top",fs+"px") } }); }); $(window).load(function() { $(".automatic-img_15").each(function(){ $img = $(this).find("img"); $w = $img.width(); $h = $img.height(); $bw= $(this).width(); $bh= $(this).height(); b1 = $w/$h; b2 = $bw/$bh; if(b1>b2){ $img.css("height","100%") $wed = $bh*b1; $img.css("width",$wed+"px") fz =($(".automatic-img_15").width()-$wed)/2; $img.css("margin-left",fz+"px") }else{ $img.css("width","100%") $hed = $bw/b1; $img.css("height",$hed+"px") fs =($(".automatic-img_15").height()-$hed)/2; $img.css("margin-top",fs+"px") } }); }); $(window).load(function() { $(".automatic-img_16").each(function(){ $img = $(this).find("img"); $w = $img.width(); $h = $img.height(); $bw= $(this).width(); $bh= $(this).height(); b1 = $w/$h; b2 = $bw/$bh; if(b1>b2){ $img.css("height","100%") $wed = $bh*b1; $img.css("width",$wed+"px") fz =($(".automatic-img_16").width()-$wed)/2; $img.css("margin-left",fz+"px") }else{ $img.css("width","100%") $hed = $bw/b1; $img.css("height",$hed+"px") fs =($(".automatic-img_16").height()-$hed)/2; $img.css("margin-top",fs+"px") } }); }); $(window).load(function() { $(".automatic-img_17").each(function(){ $img = $(this).find("img"); $w = $img.width(); $h = $img.height(); $bw= $(this).width(); $bh= $(this).height(); b1 = $w/$h; b2 = $bw/$bh; if(b1>b2){ $img.css("height","100%") $wed = $bh*b1; $img.css("width",$wed+"px") fz =($(".automatic-img_17").width()-$wed)/2; $img.css("margin-left",fz+"px") }else{ $img.css("width","100%") $hed = $bw/b1; $img.css("height",$hed+"px") fs =($(".automatic-img_17").height()-$hed)/2; $img.css("margin-top",fs+"px") } }); });