Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve the slow transition between pages in jQuery mobile?

In my Phonegap app I have 2 pages(main , form Page) When I navigate from the Main Page to the Form page it takes too time to Show the Form Page ,I am not added any java script code ,this is my jsfiddle contains my form page code [JSFiddle][1] . Is there any thing wrong in my form page which slow the transition ? How can i speed up the transition ? please help me since I am new in jQuery mobile .

Thanks in advance.

Main Page

 <html>
  <head>  
  <meta charset="utf-8" /> 
  <meta name="format-detection" content="telephone=no" />  
  <meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0,          minimum-scale=1, width=device-width,height=device-height, target-densitydpi=device-dpi" />
   <link rel="stylesheet" type="text/css" href="css/index.css" />

   <script src="js/jquery-1.8.2.min.js"></script>      
   <link href="css/jquery.mobile-1.3.2.min.css"     rel="stylesheet" type="text/css" />
   <script src="js/jquery.mobile-1.3.2.min.js"  type="text/javascript"></script>
    <script type="text/javascript" src="phonegap.js"></script>
   </head>
   <body>
    <div data-role="page"    id="Main" >
    <div data-role="header"  data-theme="b" > </div>
    <div data-role="content">
    <a href="Form.html" data-transition="none" data-role="button" data-theme="none"                       data-corners="false"><img src="images/profile.png"   /></a><BR><BR><BR>
    <font color="white"  size="6px"  >  Profile </font>
    </div>

     </div>
   </body>
  </html>
like image 951
user Avatar asked Dec 03 '25 22:12

user


1 Answers

I call this function at the beginning of every app I make with Jquery Mobile and it really speeds things up.

function optimizeSpeed() {
var hoverDelay = $.mobile.buttonMarkup.hoverDelay = 0;

$.mobile.defaultPageTransition = 'none';
$.mobile.defaultDialogTransition = 'none';
}

Not part of your question, but Jquery Mobile also works faster when you bind to the 'tap' events or especially the 'touchstart' event on button presses.

like image 166
Anthony Elliott Avatar answered Dec 06 '25 14:12

Anthony Elliott



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!