Without using a JavaScript framework like jQTouch and jQuery Mobile, is there a way to mimic the native iOS page flip animation and similar transitions using only HTML5 and CSS3?
I basically want to mimic these but without JavaScript: (you must view this page on an iPhone for it to render properly)
Without using a JavaScript framework like jQTouch and jQuery Mobile, is there a way to mimic the native iOS page flip animation and similar transitions using only HTML5 and CSS3?
I basically want to mimic these but without JavaScript: http://www.jqtouch./preview/demos/main/#animations (you must view this page on an iPhone for it to render properly)
Share Improve this question edited Nov 29, 2011 at 23:28 Jonathan Leffler 756k145 gold badges951 silver badges1.3k bronze badges asked Dec 6, 2010 at 18:32 AlexAlex 1,1524 gold badges16 silver badges30 bronze badges 1- 20thingsilearned. is using neither and testament that a lot of ui animation can be done using CSS3, though it also uses jQuery. – hlfcoding Commented Jan 25, 2011 at 6:37
2 Answers
Reset to default 3Yes, just look at the jQtouch CSS file (jqtouch.css).
All the animations are listed there. For example:
@-webkit-keyframes flipRightIn {
0% {
-webkit-transform: rotateY(-180deg) scale(.8);
}
100% {
-webkit-transform: rotateY(0deg) scale(1);
}
}
@-webkit-keyframes flipRightOut {
0% {
-webkit-transform: rotateY(0deg) scale(1);
}
100% {
-webkit-transform: rotateY(180deg) scale(.8);
}
}
Then create the animation class:
.flipright.in {
-webkit-animation-name: flipRightIn;
}
Pull what you need (since it's MIT licensed) and don't forget to attribute your source.
Yep this stuff can be done with css 3d transforms. There's a great introduction (which includes an example of the page flip animation you're after) here: http://24ways/2010/intro-to-css-3d-transforms. This stuff doesn't have great cross-browser support at the moment, but if you only need it to work on iOS you should be fine.