Table of Content
Transition
jQuery mobile provides several pre-built transition effect. We can test them all by creating link for each effect. The data-transition
is used for jQuery to determine.
Available transitions:
- none
- fade
- pop
- flip
- turn
- flow
- slide
- slide-up
- slide-down
- slide-fade
We can test all the transition effects by adding them to the page. Note the data-transition
controls which effect to use.
1<a data-role='button' data-transition='fade' href='#contact'>Fade</a> 2<a data-role='button' data-transition='pop' href='#contact'>Pop</a> 3<a data-role='button' data-transition='flip' href='#contact'>Flip</a> 4<a data-role='button' data-transition='turn' href='#contact'>Turn</a> 5<a data-role='button' data-transition='flow' href='#contact'>Flow</a> 6<a data-role='button' data-transition='slide' href='#contact'>Slide</a> 7<a data-role='button' data-transition='slideup' href='#contact'>Slide Up</a> 8<a data-role='button' data-transition='slidedown' href='#contact'>Slide Down</a> 9<a data-role='button' data-transition='slidefade' href='#contact'>Slide Fade</a> 10<a data-role='button' data-transition='none' href='#contact'>None</a>
After we choose a transition style, we can go into further tuning by adding CSS3 GPU accelerated.
CSS 3D transform is accelerated by GPU. But the 2D transform, such as translateX
, is not accelerated by GPU. So on the transition effect we use, we can overwrite those 2D transform functions to 3D ones.
For more detail on how those easing functions affect the UI animation, check this post: Animation Principles in UI Design: Understanding Easing.
What’s next? We’re going to take a look at “Customize page transition”.