Malformed jQuery Mobile dialog in web app on mobile screens -

i have webapp in dialog box appears on specific page gets malformed reason. please see link below example
it seems because of these lines of code shows loading animation.
js:
//show loading screen before pagehide $(document).on('pagebeforehide', '[data-role="page"]',function(e,data){ var loader = setinterval(function(){ $.mobile.loading('show'); clearinterval(loader); },1); }); //hide loading screen on pageshow $(document).on('pageshow', '[data-role="page"]',function(e,data){ var loader = setinterval(function(){ $.mobile.loading('hide'); clearinterval(loader); },1); }); $(document).on('pagebeforeshow', '[data-role="dialog"]',function(e,data){ var loader = setinterval(function(){ $.mobile.loading('hide'); clearinterval(loader); },1); }); when change
$(document).on('pagebeforeshow', '[data-role="dialog"]',function(e,data) to
$(document).on('pageshow', '[data-role="dialog"]',function(e,data) the malformed dialog shows moment returns normal.
html:
<div data-role="dialog" id="loginpage" data-close-btn="none"> <div data-role="header"> <img src="./images/chune-logo-white-logo.png" alt="logo" style="margin-left: auto; margin-right: auto; display: block;"></div> <div data-role="content"> <form id="loginform"> <div data-role="fieldcontain" class="ui-hide-label"> <label for="username">username:</label> <input type="text" name="username" id="username" value="" placeholder="username" /> </div> <div data-role="fieldcontain" class="ui-hide-label"> <label for="password">password:</label> <input type="password" name="password" id="password" value="" placeholder="password" /></div> <input type="submit" value="login" id="submitbutton"> </form> <div style="text-align: center;">or</div> <!--need center--> <a href="./register.html" data-role="button">register</a> </div> <div data-role="footer"> <h4>© chune</h4> </div> </div> how can stop dialog , others becoming malformed on small screen devices shows normal on desktops , laptops.
Comments
Post a Comment