Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The <code>min-height</code> of the <code>data-role="page"</code> element is set via JavaScript in a <code>resize</code> event handler for the <code>window</code> object. You can create your own JavaScript that resizes the page differently:</p> <pre><code>$(function () { $(window).bind('resize', function (event) { var content_height = $.mobile.activePage.children('[data-role="content"]').height(), header_height = $.mobile.activePage.children('[data-role="header"]').height(), footer_height = $.mobile.activePage.children('[data-role="footer"]').height(), window_height = $(this).height(); if (content_height &lt; (window_height - header_height - footer_height)) { $.mobile.activePage.css('min-height', (content_height + header_height + footer_height)); setTimeout(function () { $.mobile.activePage.children('[data-role="footer"]').css('top', 0); }, 500); } event.stopImmediatePropagation(); }).trigger('resize'); }); </code></pre> <p>Here is a demo: <a href="http://jsfiddle.net/sAs5z/1/" rel="noreferrer">http://jsfiddle.net/sAs5z/1/</a></p> <p>Notice the <code>setTimeout</code> used to set the <code>fixed-position-footer</code>; the timeout duration can probably be made smaller. This is used because the jQuery Mobile Framework was re-positioning the <code>fixed-position-footer</code> back to the bottom of the page. An example of this can be seen here: <a href="http://jsfiddle.net/sAs5z/" rel="noreferrer">http://jsfiddle.net/sAs5z/</a></p> <p>Another note, you may want to only re-position the <code>fixed-position-footer</code> element and leave the page's <code>min-height</code> property the same; this will make the page gradient cover the whole screen but the footer won't have any space between it and the content. Here is a demo of this method: <a href="http://jsfiddle.net/sAs5z/2/" rel="noreferrer">http://jsfiddle.net/sAs5z/2/</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload