在Jquery移动应用程序中闪烁页面转换 [英] Flickering page transitions in Jquery mobile app
问题描述
如何在Web应用程式的行动版网页转换期间,克服闪烁转换/白色闪光/跳跃?我使用Jquerymobile和Phonegap的(.js)文件。没有任何解决方案发布在 https://github.com/jquery/jquery-mobile/issues / 4024 或其他网站为我工作。我不使用单独的jqueryTransition.js文件。任何帮助真的赞赏。
How do i overcome the Flickering transition/ white-flash/ jumps during Mobile page transitions in a Web app? I use Jquerymobile and Phonegap's (.js) files. None of the solutions posted on https://github.com/jquery/jquery-mobile/issues/4024 or other sites worked for me. I do not use a separate jqueryTransition.js file. Any help really appreciated.
推荐答案
防止闪烁的唯一真正的方法是完全禁用jQuery Mobile页面转换。在文档的< head>
中,输入以下代码:
The only real way to prevent the "flickering" is to disable the jQuery Mobile page transitions altogether. In the <head>
of your document, place this code:
// load jQuery
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
// load your custom jQuery Mobile Defaults
<script type="text/javascript" src="mobile/js/mobile-site-custom-jqm-defaults.js"></script>
// load jQuery Mobile
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
// load your scripts.js (your javascript & functions, etc.)
<script type="text/javascript" src="mobile/js/script.js"></script>
要禁用转换,请在 mobile-site-custom-jqm- defaults.js
文件,请输入以下代码:
To disable transitions, inside of the mobile-site-custom-jqm-defaults.js
file, place this code:
$(document).bind("mobileinit", function(){
$.extend( $.mobile , {
defaultPageTransition: 'none'
});
});
这篇关于在Jquery移动应用程序中闪烁页面转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!