Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Update docs/pages/page-customtransitions.html
Browse files Browse the repository at this point in the history
  • Loading branch information
agcolom committed Mar 25, 2012
1 parent 6a13b32 commit 44ee956
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions docs/pages/page-customtransitions.html
Expand Up @@ -31,24 +31,25 @@ <h2>Creating custom CSS-based transitions</h2>
<p>To create a custom CSS transition, select a class name that corresponds to the name of your transition, for example "slide", and then define your "in" and "out" CSS rules to take advantage of transitions or animation keyframes:</p>

<pre><code>
.slide.in {
-webkit-transform: translateX(0);
-webkit-animation-name: slideinfromright;
}

.slide.out {
-webkit-transform: translateX(-100%);
-webkit-animation-name: slideouttoleft;
}

@-webkit-keyframes slideinfromright {
from { -webkit-transform: translateX(100%); }
to { -webkit-transform: translateX(0); }
}
@-webkit-keyframes slideouttoleft {
from { -webkit-transform: translateX(0); }
to { -webkit-transform: translateX(-100%); }
}
.slide.in {
-webkit-transform: translateX(0);
-webkit-animation-name: slideinfromright;
}

.slide.out {
-webkit-transform: translateX(-100%);
-webkit-animation-name: slideouttoleft;
}

@-webkit-keyframes slideinfromright {
from { -webkit-transform: translateX(100%); }
to { -webkit-transform: translateX(0); }
}

@-webkit-keyframes slideouttoleft {
from { -webkit-transform: translateX(0); }
to { -webkit-transform: translateX(-100%); }
}
</code></pre>

<p>During a CSS-based page transition, jQuery Mobile will place the class name of the transition on both the "from" and "to" pages involved in the transition. It then places an "out" class on the "from" page, and "in" class on the "to" page. The presence of these classes on the "from" and "to" page elements then triggers the animation CSS rules defined above. As of jQuery Mobile version 1.1, animation class additions are queued, rather than simultaneous, producing an out-then-in sequence, which is friendlier for mobile rendering than our previous simultaneous transition sequence.</p>
Expand Down

1 comment on commit 44ee956

@scottjehl
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we get the -moz keyframes in here too? Just so it matches the code?

Please sign in to comment.