raymaru
raymaru

Reputation: 15

How to set a height of the panel equal to the content in jquery mobile?

 $(document).ready(function () {
var contentheight = $(".ui-page").height();
$(".ui-panel").css("height",contentheight);});  

For the Jquery Mobile, the panel is not extending the height of the content div. I was trying to make the the code above but it doesnt fill up the height of the panel. specially if the content has a collapsible div.

Thanks

Upvotes: 0

Views: 178

Answers (1)

ezanker
ezanker

Reputation: 24738

You can do this with pure CSS:

.ui-panel .ui-panel-inner {
    overflow: auto;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0px;  
    -webkit-overflow-scrolling: touch;
}

Here is a DEMO

Upvotes: 1

Related Questions