Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS5 + jquery-mobile transition blinks

I am trying to remove an annoying flickering effect on jqmobile transitions when running on iOS 5. I tried several methods from other posts like -webkit-backface and did some other work but does not reach complete solution. I observed that flickr occurs when, before transition, page is repositioned due to navigation bar is displaced one pixel (maybe 2) from top. Problem begins on initialization or after device rotation when page is rerendered and then we got two possible working results,

  1. Working without flickering and expected on each transition.
  2. Falls on each transition appearing described blink.

problem, of course, is that you get 1 or 2 randomly when new page render. Thank you.

like image 762
Jaume Avatar asked Jun 05 '12 19:06

Jaume


People also ask

What are the transition effects available in jQuery Mobile?

The jQuery Mobile framework includes a set of CSS-based transition effects that can be applied to any page link or form submission with Ajax navigation: fade dialog page pop dialog page flip dialog page turn

What are the different browsers for transitions?

All transitions are built with CSS keyframe animations and include both -webkitvendor prefixed rules for iOS, Blackberry, Android, Safari and Chrome browsers and -mozrules for Firefox browsers.

How do I view all transition types on a 3D device?

To view all transition types, you must be on a browser that supports 3D transforms. By default, devices that lack 3D support (such as Android 2.x) will fallback to "fade" for all transition types. This behavior is configurable (see below).


2 Answers

If you have data-position="fixed" then a solution is to use:

<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" /> 
like image 195
cherouvim Avatar answered Oct 12 '22 23:10

cherouvim


Source: https://github.com/jquery/jquery-mobile/issues/4024#issuecomment-5124172

Instead of data-position:fixed to the header / footer - I applied the following CSS styles to the header, content and footer:

.header {
    position : fixed;
    z-index  : 10;
    top      : 0;
    width    : 100%
}
.content {
    padding : 45px 15px
}
.footer {
    position : fixed;
    z-index  : 10;
    bottom   : 0;
    width    : 100%
}

Several people on the forum at the above link have stated that this has helped with flashes when transition between pages with data-position:fixed header/footer.

Another suggestion from Tod Parker (a jQuery Mobile creator) was this:

.ui-mobile-viewport-transitioning .ui-header-fixed,
.ui-mobile-viewport-transitioning .ui-footer-fixed { visibility: hidden; }

Which hides the fixed header/footer while transitioning from one page to another.

Source: https://github.com/jquery/jquery-mobile/issues/4024#issuecomment-5250856

There was also a commit made by another jQuery Mobile team member that should show-up in the next release. Here is the post: https://github.com/jquery/jquery-mobile/issues/4024#issuecomment-5250856 (the code is a bit complex to post here)

Very recently the issue was closed due to this commit: https://github.com/Diveboard/jquery-mobile/commit/ff125b65e682ecd33888a6db1221ac441d258994. This fix was to set the z-index of the incoming page to -10 before scrolling and then resetting the z-index afterwards.

I haven't attempted any of these fixes myself but they seem to be promising.

like image 22
Jasper Avatar answered Oct 13 '22 00:10

Jasper