我在的PhoneGap / jQuery Mobile的新手,我与网页过渡过程中的问题白屏面对的问题。我试过申请,我已经在网上发现了许多解决方案(例如 -webkit-背面能见度:隐藏;
),仍然没有解决的问题。
I'm newbie in Phonegap/jQuery mobile and I'm facing with white screen during page transition problem. I've tried to apply many solutions that I've found on web(for example -webkit-backface-visibility:hidden;
) and still haven't solved the problem.
我还设置 defaultPageTransition
到无
(在jQuery Mobile的.js文件),仍然一无所获。
I've also set defaultPageTransition
to none
(in jQuery mobile .js file) and still nothing.
我不能,因为我需要它为我的 iDangerous 刷卡菜单中关闭硬件加速。我所有的链接看起来是这样的:
I mustn't turn off hardware acceleration because I need it for my iDangerous swiper menu. All my links look like this:
<a href='javascript:void(0)' class='news-main' onclick='someFunction()'>Some String</a>
当我点击链接someFunction()被调用。方法someFuction看起来是这样的:
When I click on link someFunction() is called. Method someFuction looks like this:
function someFunction(){
//setting some value that I need in next page
window.sessionStorage.setItem("someValue",someValue);
window.location="next-page.html";
}
除了网页过渡期间白光闪过,一切工作正常。而且它仅表现在某些设备(如安卓4.0 +)。
Everything works OK except that white flash during page transition. And it is showed only on some devices(for example Android 4+).
有什么办法来解决这个问题?或者,也许我做错了什么?在此先感谢!
Is there any way to solve this issue? Or maybe I'm doing something wrong? Thanks in advance!
推荐答案
尝试如下
<a href='#' class='news-main' id='mylink'>Some String</a>
JS
$(document).on('pagecreate', function(){
$('#mylink').bind('click',function(){
someFunction()
});
});
function someFunction(){
window.sessionStorage.setItem("someValue",someValue);
$.mobile.changePage("next-page.html");
}
相关推荐
最新文章