var galleryItems = new Array(); var imageHeight; var imageWidth; var currentImageIndex; var minImageHeight = 500; var thumbnailBarHeight = 80; var footerHeight = 76; $(document).ready(function() { recalculateGalleryHeight(); Galleria.loadTheme('galleria/themes/classic/galleria.classic.js'); $('#galleria').galleria({ preload: 5, showInfo: true }); }); $(window).resize(function() { recalculateGalleryHeight(); }); function recalculateGalleryHeight() { var avail_height = getMaxAvailableContentHeight(); $("#galleria").height(avail_height); } function getMaxAvailableContentHeight() { var avail_height = getMaxImageHeight(); avail_height += thumbnailBarHeight; avail_height -= footerHeight; return avail_height; } function getMaxImageHeight() { var height = $(window).height(); var top_height = $(".ui_top_bar").outerHeight(); var bottom_height = $(".ui_footer").outerHeight(); var avail_height = height - top_height - bottom_height; var padding = parseInt($(".body").css("padding-top"), 10) + parseInt($(".body").css("padding-bottom"), 10); avail_height -= padding; //if(avail_height < minImageHeight) { // avail_height = minImageHeight + padding; //} return avail_height; };