Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7564071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:49:24+00:00 2026-05-30T13:49:24+00:00

I have a project with jQuery Mobile + phonegap and I have some issues

  • 0

I have a project with jQuery Mobile + phonegap and I have some issues with the footer and content div.

A basic jQuery Mobile page looks like this:

<div data-role="page" data-theme="b" id="map">

    <div data-role="header" data-theme="b" data-position="inline">
        <a href="#" data-rel="back" data-icon="arrow-l">Back</a>
        <h1>MAP</h1>
    </div><!-- /header -->

    <div data-role="content" id="map_canvas">
    </div><!-- /content -->

    <div data-role="footer" data-theme="d">
        <h4>TEST</h4>
    </div><!-- /footer -->
</div><!-- /page -->

Now I’m trying to load google maps in the content so I use this in JavaScript:

$('div').live("pageshow", function()
{
    var myOptions = {
      center: new google.maps.LatLng(-34.397, 150.644),
      zoom: 8,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    map = new google.maps.Map(document.getElementById("map_canvas"),
        myOptions); 
}

And this is the result:

Page with footer after content

The problem is that the footer doesn’t stick to the bottom unless you specify the attribute data-position="fixed" like this:

<div data-role="footer" data-theme="d" data-position="fixed">
    <h4>TEST</h4>
</div><!-- /footer -->

That’s fine but the problem is the map is loading before jquery mobile take the footer to the bottom, as a result I have this page:

Page with footer fixed

Where you can see the map only using the space left before it’s moved to the bottom.

My question is.. what event should I wait for or what do I need to add to my code in order to load the map so it will use all the space between header and footer?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T13:49:26+00:00Added an answer on May 30, 2026 at 1:49 pm

    You don’t need to wait for an event, you need to set the .ui-content element’s height to something around 100%.

    Here is a purely CSS method of achieving 100% height for a jQuery Mobile pseudo-page:

    /*make sure the viewport is 100% height*/
    html, body {
        height : 100%;
    }
    
    /*make the page element 100% height*/
    #map-page {
        height : 100%;
    }
    
    /*specify a height for the header so we can line-up the elements, the default is 40px*/
    #map-page .ui-header {
        height : 40px;
    }
    
    /*set the content to be full-width and height except it doesn't overlap the header or footer*/
    #map-page .ui-content {
        position : absolute;
        top      : 40px;
        right    : 0;
        bottom   : 30px;
        left     : 0;
    }
    
    /*absolutely position the footer to the bottom of the page*/
    #map-page .ui-footer {
        position : absolute;
        bottom   : 0;
        left     : 0;
        width    : 100%;
        height   : 30px;
    }​
    

    Here is a demo: http://jsfiddle.net/jasper/J9uf5/2/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my jQuery Mobile project, I have a page that shows a slide's content.
I have a django project, but for some reason basic jquery isn't working. <html>
I have a local jQuery Mobile project going (inside PhoneGap, thus file:// protocol) where
in this project im using jquery and phonegap i have a link that if
On a jQuery Mobile project, I have a div which is on position: fixed
I have trouble integrating jquery mobile for my django project. Especially the log-in functionality
I have this sample MVC project using jQuery grid. There is only one problem
I made a Blackberry Webworks project using jquery mobile and phonegap. When I go
I have a project using jQuery and a lot of dynamically-generated content. There is
I have a very simple .NET MVC3 project set up using jquery mobile for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.