admin管理员组文章数量:1318580
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.
I've also set defaultPageTransition
to none
(in jQuery mobile .js file) and still nothing.
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>
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";
}
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!
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.
I've also set defaultPageTransition
to none
(in jQuery mobile .js file) and still nothing.
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>
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";
}
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!
Share Improve this question edited Feb 4, 2016 at 10:34 Xan 77.6k18 gold badges197 silver badges217 bronze badges asked May 27, 2013 at 17:25 KolovratKolovrat 491 silver badge6 bronze badges 1- See stackoverflow./a/16692917/104746 --- Setting viewport to user-scalable=no fixed the problem for me. – Yaakov Belch Commented Aug 6, 2013 at 15:35
6 Answers
Reset to default 3you need something before call Jquery mobile js do like this:
<script src="js/jquery-1.10.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).bind("mobileinit", function()
{
if (navigator.userAgent.indexOf("Android") != -1)
{
$.mobile.defaultPageTransition = 'none';
$.mobile.defaultDialogTransition = 'none';
}
});
</script>
<script src="js/jquery.mobile-1.3.2.min.js" type="text/javascript"></script>
thats enough refer
android:hardwareAccelerated="false"
Open your manifest and paste this inside application tag. Because your device hardwareAccelerated call every time
Try as below
<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");
}
When building for higher Android targets the android:hardwareAccelerated is implicitly be set to true which is causing flickering during transitions with jQuery Mobile.
Setting it to android:hardwareAccelerated="false" will fix this. (I also have zoom and user scalable disabled)
http://developer.android./guide/topics/graphics/hardware-accel.html
<script src="js/jquery-1.10.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).bind("mobileinit", function()
{
if (navigator.userAgent.indexOf("Android") != -1)
{
$.mobile.defaultPageTransition = 'none';
$.mobile.defaultDialogTransition = 'none';
}
});
</script>
<script src="js/jquery.mobile-1.3.2.min.js" type="text/javascript"></script>
You can write your links as
<a href='javascript:void(0)' class='news-main' onclick='someFunction()' data-transition="none" >Some String</a>
as jquery mobile is not very smooth in page transitions.Hence we can choose to turn them off for the sake of now untill the latest version of jquery mobile with normal page transitions gets released.
本文标签: javascriptPhonegapjQuery mobile page transition flickeringStack Overflow
版权声明:本文标题:javascript - PhonegapjQuery mobile page transition flickering - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742045763a2417773.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论