白色闪光之间的页面与PhoneGap和移动应用程序的jQuery Mobile [英] White flash between pages with PhoneGap and jQuery Mobile for mobile app

查看:158
本文介绍了白色闪光之间的页面与PhoneGap和移动应用程序的jQuery Mobile的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当在iPhone上使用jQuery Mobile和PhoneGap在页面之间导航时,会出现一个烦人的白色闪烁,在新页面加载之前显示。这样一个简单的链接将导致:

When navigating between pages using jQuery Mobile and PhoneGap on iPhone, there is an annoying white flash that displays just before the new page loads. A simple link like this will cause this:

<a href="user.html" rel="external" data-role="button">User details</a>

如何解决这个问题?一个合理的解决方法可能是将白色闪光更改为与我的网页背景颜色相同的颜色,但我不知道这是否可能。

How can I fix this? A reasonable workaround may have been to change the white flash to the same color as my web page background color, but I don't know if this is possible either.

更新:

我在iPhone iOS 5.1上使用PhoneGap 1.5.0(aka Cordova),jQuery 1.6.4和jQuery Mobile 1.0.1和5.2。

I'm using PhoneGap 1.5.0 (aka Cordova), jQuery 1.6.4 and jQuery Mobile 1.0.1 on iPhone IOS 5.1 and 5.2.

问题似乎在Safari桌面上持续存在(虽然不太明显)。在Firefox上没有问题。

The problem appears to persist in Safari desktop (although much less visible). There is no problem on Firefox.

更新2:

绝对是由将链接标记为rel =external造成的。不幸的是,我链接到jQuery Mobile多页面,所以这是必要的。

The flashing is definitely caused by marking the link as rel="external". Unfortunately I am linking to jQuery Mobile multipages, so this is necessary.

推荐答案

jQuery Mobile 1.1.0 RC2发布)和jQuery 1.7.1不会遭受这个问题!精彩。从jQuery Mobile团队的伟大的工作。我知道这个错误正在困扰他们!

A combination of jQuery Mobile 1.1.0 RC2 (just released) and jQuery 1.7.1 does not suffer from this problem!!! Wonderful. Great work from the jQuery Mobile team. I know this bug was haunting them!

更新:

如果您仍然看到闪光灯,通过在CSS中提供共同的body背景颜色来提高用户体验。例如,如果你使用一个黑暗的主题,然后添加到你的主题的CSS会改变白色闪光灯为黑色闪光灯:

If you still see a flash, you can drastically improve the user experience by supplying a common body background color in your CSS. For example, if you are using a dark theme, then adding this to your theme's CSS will change the 'white' flash to a 'black' flash:

body{
   background-color: black !important
}

此外,如果你可以在你的链接中不使用rel =external,那么闪光灯也会消失。不幸的是,根据您的设计,这可能会导致您的导航。

Also, if you could get away without using rel="external" in your links, then the flash will be gone also. Unfortunately, depending on your design, this will possibly screw up your navigation.

我刚更新到qQuery Mobile 1.1.0 final。在链接到外部网页时,即使不使用多页, ,闪光灯是可见的,只有当您链接的网页很复杂一会儿。

I just updated to qQuery Mobile 1.1.0 final. The flash is visible when linking to external pages, i.e. not using multipage, but the flash is only a problem if the page you are linking to is complex (large) and takes a while to render. In those cases, keeping a consistent background makes the user experience quite alright.

删除页面过渡效果还会通过在包含以下javacript之前包含以下javacript来将中断保持在最低限度: jquery移动库。

Removing the page transition effects will also keep the interruption to a minimum by including the following javacript before including the jquery mobile library.

$(document).bind("mobileinit", function(){
  $.mobile.defaultPageTransition="none"
});

这篇关于白色闪光之间的页面与PhoneGap和移动应用程序的jQuery Mobile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆