Skip to content

Instantly share code, notes, and snippets.

@Rockncoder
Created July 11, 2012 12:08
Show Gist options
  • Select an option

  • Save Rockncoder/3089978 to your computer and use it in GitHub Desktop.

Select an option

Save Rockncoder/3089978 to your computer and use it in GitHub Desktop.
jQuery Mobile - dynamically size the content area
// determine the size of the jQuery Mobile content area for dynamic sizing
RocknCoder.Dimensions = (function () {
var width, height, headerHeight, footerHeight, contentHeight,
getContentDimensions = function () {
return {
width: width,
height: contentHeight
};
},
init = function () {
width = $(window).width();
height = $(window).height();
headerHeight = $("header", $.mobile.activePage).height();
footerHeight = $("footer", $.mobile.activePage).height();
contentHeight = height - headerHeight - footerHeight;
};
return {
init: init,
getContent: getContentDimensions
};
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment