Skip to content

Outer panel in JQuery Mobile

August 8, 2013

If you have an outer panel in JQuery Mobile that is outside the div component containing data-role=”page”, which is used in responsive design (for larger web browser dimensions), it would be useful to know how to set this panel to responsively set the height to the window. From previous experience, panels outside the data-role=”page” do not set the height correctly to 100%.

Here is code that can respond to the document height which is the HTML document component, and set the panel to that height dynamically even on a rseize of the web browser window using $(window).resize(function().

 

$(document).ready(function() {

          $(‘.outer-panel’).height($(document).height());

          $(window).resize(function() {
            $(‘.outer-panel).height($(document).height());
          });

});

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: