javascript - jquery mobile 1.3.1 padding-top incorrectly calculated on initial page load -


i've been googling days , although there many similar threads answer still eludes me. have pared problem down this:

<div data-role="header" data-id="myheader" data-theme="none" data-position="fixed">         <img src="images/my1200x150logo.jpg"/> </div><!-- /header -->  <div data-role="content">     <p>content line 1</p>     <p>content line 2</p>     <p>content line 3</p>     <p>content line 4</p>     <p>content line 5</p> </div><!-- /content -->  <div data-role="footer" data-id="myfooter" data-theme="c" data-position="fixed">    <h4>my footer</h4> </div><!-- /footer --> 

i trying achieve rwd effect logo image resizing fit page. works except initial page load, sets padding-top 0 in jqm updatepagepadding routine causing content flow under image.

i understand images load hours after js run , common issue. event such page resize causes padding updated correctly.

so question is, how can force jqm call updatepagepadding after image(s) have finished loading ?

jquery pageshow event ? link api

basically jquery fire event after page loaded, , elements ready can wait event , call function, example:

$("#pageid").on("pageshow",function(){    updatepagepadding(); }); 

also check complete reference on events binded every jquery mobile page, page widget api


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -