$j('#photoPluginWrapper979625').removeAttr('style'); $j('.photoGalleryWrapDiv').height($j(window).height()); $j(window).resize(function () { $j('.photoGalleryWrapDiv').css('height', $j(window).height()); //changes height dynamically of div based on window height }); $j('.photoGalleryWrapDiv').width($j(window).width()); $j(window).resize(function () { $j('.photoGalleryWrapDiv').css('width', $j(window).width()); //changes width dynamically of div based on window width }); //aspect ratio var theWindow = $j(window), $jbg = $j(".photoGalleryWrapDiv img"), aspectRatio = $jbg.width() / $jbg.height(); function resizeBg() { if ((theWindow.width() / theWindow.height()) < aspectRatio) { $jbg .removeClass() .addClass('bgheight'); } else { $jbg .removeClass() .addClass('bgwidth'); } } theWindow.resize(function () { resizeBg(); }).trigger("resize"); //Position fixed for IE b/c of old doctype if ($j.browser.msie) { $j('.photoGalleryWrapDiv img').css('position', 'absolute'); $j(window).scroll(function () { $j('.photoGalleryWrapDiv img').css('top', $j(this).scrollTop() + "px"); }); }