jquery-mobile - 如何解决 jQuery Mobile 中页面之间转换缓慢的问题?

标签 jquery-mobile cordova

在我的 Phonegap 应用程序中,我有 2 个页面(主页面、表单页面)当我从主页导航到表单页面时,显示表单页面花费的时间太长,我没有添加任何 java 脚本代码,这是我的jsfiddle 包含我的表单页面代码 [JSFiddle][1] 。我的表单页面有什么问题会减慢转换速度吗?我怎样才能加快过渡?请帮助我,因为我是 jQuery Mobile 的新手。

提前致谢。

主页

 <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>

最佳答案

我在使用 Jquery Mobile 制作的每个应用程序的开头调用此函数,它确实加快了速度。

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

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

这不是您的问题的一部分,但当您绑定(bind)到“点击”事件或尤其是按下按钮时的“touchstart”事件时,Jquery Mobile 的工作速度也会更快。

关于jquery-mobile - 如何解决 jQuery Mobile 中页面之间转换缓慢的问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20926466/

相关文章:

javascript - 手机上的 iFrame 重定向和重新加载主页问题

ios - 从 WKWebview 从 cordova-ios 的数据目录加载 html 文件

ios - 音隙构建 : Not receiving ios push notifications

Cordova/PhoneGap无法添加WP7/WP8/Windows平台

android - IBM Worklight 应用程序无法在 Xcode 中运行

ios - 如何允许 Cordova 6.1 应用程序从网站在 iOS 中嵌入 iframe?

javascript - 使用 jQuery 按值选择下拉选项

jQuery Mobile 弹出窗口影响页面布局?

javascript - jQuery Mobile "enhance"动态重新生成html

html - 添加值以翻转切换开关