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

Commit

Permalink
Merge pull request #3914 from agcolom/patch-67
Browse files Browse the repository at this point in the history
Update docs/pages/page-customtransitions.html
  • Loading branch information
toddparker committed Mar 26, 2012
2 parents 6a13b32 + 44ee956 commit 3120f53
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

0 comments on commit 3120f53

Please sign in to comment.