tronc
tronc

Reputation: 693

panel height size calc on pageinit

please take a look at the following screenshot:

wrong layout

The first time opening the page the height of the right panel isn't calculated correctly and doesnt fill the whole <div data-role="content"> section.

Opening or clicking into the page seems to trigger the pageshow or some other event and the logo is centered in the middle and the panels height is calculated correctly to height 100% of the content div.

the right layout would be this:

correct layout

Where is my problem here?

I read that the exact pageheight is known first in the pageshow event of jqm. the height of the content-div or the panel(?) seems to be calculated too late. is there a possibility to trigger an update manually?

Is this my error or do i miss here something completly different? Is there a workaround for this problem?

Upvotes: 2

Views: 248

Answers (1)

Omar
Omar

Reputation: 31732

When working with dynamic items call $.mobile.resetActivePageHeight(); on pageshow.

Moreover, $.mobile.resetActivePageHeight(); function can be called anytime, especially when appending header/footer to a page dynamically.

Upvotes: 2

Related Questions