JQuery Mobile code for flickering navigation using PhoneGap

I believe this post is a solution to my problem Flicker when navigating between pages . In particular:

$(document).bind("mobileinit", function()
{
   if (navigator.userAgent.indexOf("Android") != -1)
   {
     $.mobile.defaultPageTransition = 'none';
     $.mobile.defaultDialogTransition = 'none';
   }
});

I come from the world of C # and almost incoherently, like to jQuerymobile. I would like to add this snippet, but I don’t know where. If that matters, I think I’ll add it to jquery.mobile-1.1.0.rc.1.js, but then I don’t know where it is if it is the correct file.

+5
source share
2 answers

This code should be run after the jQuery kernel is turned on and before jQuery Mobile is turned on. The reason is that jQuery must be present to run the code, but this event handler must be bound before initializing jQuery Mobile.

For instance:

<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script>
$(document).bind("mobileinit", function()
{
   if (navigator.userAgent.indexOf("Android") != -1)
   {
     $.mobile.defaultPageTransition = 'none';
     $.mobile.defaultDialogTransition = 'none';
   }
});
</script>
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>

: http://jquerymobile.com/demos/1.1.0/docs/api/globalconfig.html

, UA , jQuery Mobile CSS 3D , . jQuery Mobile 1.1.0+, fade, .

3D-

, fade, . , 3D, , . , Android 2.x - . , , Android 3.0, 3D , , 100% , .

, 3D- , "" . , "none":

$.mobile.transitionFallbacks.slideout = "none"

: http://jquerymobile.com/demos/1.1.0/docs/pages/page-transitions.html

, , if/then , , , Android, / .

:

<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script>
if (navigator.userAgent.indexOf("Android") != -1)
{
    $(document).bind("mobileinit", function()
    {
      $.mobile.defaultPageTransition = 'none';
      $.mobile.defaultDialogTransition = 'none';
    });
}
</script>
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
+14

, , , . mini Android 2.3.6, UX.

, - , .

$(document).on("mobileinit", function(){
        $.mobile.defaultPageTransition = 'slide';
        $.mobile.transitionFallbacks='none';
});

, ! , , !

0

All Articles