iphone jquery mobile flickering issue

此生再无相见时 提交于 2019-12-05 18:45:34

While I was searching for flickering header and footer during transitions I've found this SO thread as well as: http://view.jquerymobile.com/1.3.1/dist/demos/widgets/fixed-toolbars/footer-persist-a.html

It's that simple: If the page you're navigating to has a header or footer with the same data-id as the page you're navigating from, the toolbars will appear fixed outside of the transition.

<div id="sell" data-role="page" > 
    <div data-role="header" data-id="header" data-position="fixed">
        <h1>Seconds.me</h1>
        <a data-role="button" href="#buy" data-icon="arrow-l" data-theme="app-ios" style="color: white; text-decoration: none;">Back</a>
    </div>

      <h3>1</h3>
      <a href="#buy">2</a>

  </div>  

  <div id="buy" data-role="page" > 
    <div data-role="header" data-id="header" data-position="fixed">
        <h1>Seconds.me</h1>
        <a data-role="button" href="#sell" data-icon="arrow-l" data-theme="app-ios" style="color: white; text-decoration: none;">Back</a>
    </div>

      <h3>2</h3>
      <a href="#sell">1</a>

  </div>

Was flickering, now flickers it not. See data-id="header" which the same for both pages.

(hope that helps)

UPDATE: http://jquerymobile.com/demos/1.2.0/docs/pages/page-transitions.html --> this page also tackles flickering...

Try to download and use the latest version jquery(1.8.2) and jquery mobile(1.2.0) and its css(1.2.0).

Regards

Did you do the following workaround:

.ui-page { -webkit-backface-visibility: hidden; }

As stated here

Important: Some platforms currently have issues with transitions. We are working on a solution to solve the problem for everyone. If you are experiencing flickers and flashes during or at the end of a transition we suggest the following workaround. Please note that this workaround should be throughly tested on the target platform before deployment. This workaround is known to cause performance issues, and browser crashes on some platforms especially Android.

Here, I come with the solution........

Please follow the sequence

// First of all jQuery
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>

// then load custom jQuery Mobile
<script type="text/javascript" src="mobile/js/mobile-jqm.js"></script>

// then load jQuery Mobile
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>

// finally load your own scripts (.js) files 
<script type="text/javascript" src="mobile/js/script.js"></script>

To disable transitions, create mobile-jqm.js filt & inside of the mobile-jqm.js file, place this code:

$(document).bind("mobileinit", function(){
  $.extend(  $.mobile , {
   defaultPageTransition: 'none'
  });
});
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!