cordova - how to speed up changepage in jquery mobile for phonegap app -


i using jquerymobile 1.3.1 phonegap android app. change page methord slow (more 1 sec) in android without page transition (defaultpagetransition=none).

touchstart , tap events firing on next page form elements..

any idea?

there few ways:

  • in case using 1 html file multiple pages, wrap them single div:

    <div id="container"/> 

    and set css:

    body {     margin: 0; }  #container {     position: absolute;     width: 100%;     height: 100%; } 

    js code:

    $(document).one("mobileinit", function () {     $.mobile.pagecontainer = $('#container');     $.mobile.defaultpagetransition = 'slide'; }); 

    more aproach can found here: http://outof.me/fixing-flickers-jumps-of-jquery-mobile-transitions-in-phonegap-apps/

  • other common solution set css: .ui-page { -webkit-backface-visibility: hidden; }

the problem solution breaks select list on forms.

  • turn them off:

    $(document).bind("mobileinit", function(){     $.mobile.defaultdialogtransition = "none";     $.mobile.defaultpagetransition = "none"; }); 
  • use fastclick on jquery mobile apps speed click events speeding page transitions. click events can add 300ms page transition. plugin more in case enough.

link: https://github.com/drowne/jquery.mobile.fastclick

  • in case don't want additional plugins can still achieve faster page transition removing href page changing buttons , doing this:

    <a class="ui-btn-left" data-icon="arrow-l" href="#" data-theme="a" id="back-btn">back</a>  $('#back-btn').bind('touchstart', function(e) {     $.mobile.changepage("#pageid"); }); 

    the touchstart (or touchend) event works great if know user won't scrolling. that's reason click events take long resolve on mobile devices, device waiting see if user scrolling or clicking. touchstart should not have delay common click/tap event.

    i hope of solutions you. take consideration, these not bulletproof solution , have downsides of own.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -