Maria Piaredryj
Maria Piaredryj

Reputation: 1662

jQuery Mobile + PhoneGap - Side Panel doesn't stretch on $(document).height();

I make html+css+js for PhoneGap android application and I have some issue: jQuery Mobile side panel doesn't stretch on page's height, so I used following code:

HTML

<div data-role="panel" data-display="overlay" data-position="left" data-theme="a" id="main-nav">
    Navigation
</div>

JS

$("#main-nav").css({
   "height": $(document).height() + "px"
});

In usual browser it works! Chrome for Android, Browser on Samsung Galaxy handle it correctly. But after compiling to .apk panel gets height not from document, but window, so it has viewport's height! What should I do with this?

Upvotes: 0

Views: 82

Answers (1)

joe
joe

Reputation: 1489

what if you do
#main-nav { position: absolute; top: 0; bottom: 0; }
that should stretch your div to the available area of the parent (considering it's not taking all the viewport in itself).

Upvotes: 1

Related Questions