Created
July 11, 2012 12:08
-
-
Save Rockncoder/3089978 to your computer and use it in GitHub Desktop.
jQuery Mobile - dynamically size the content area
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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