Skip to content

Commit b418409

Browse files
author
scottjehl
committed
updated slide transition to use the simultaneous handler.
1 parent d9b83b2 commit b418409

File tree

2 files changed

+35
-15
lines changed

2 files changed

+35
-15
lines changed
Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,54 @@
11
/* slide transition */
2+
.slide.out, .slide.in {
3+
-webkit-animation-timing-function: ease-out;
4+
-webkit-animation-duration: 350ms;
5+
-moz-animation-timing-function: ease-out;
6+
-moz-animation-duration: 350ms;
7+
}
28
.slide.out {
39
-webkit-transform: translateX(-100%);
410
-webkit-animation-name: slideouttoleft;
511
-moz-transform: translateX(-100%);
612
-moz-animation-name: slideouttoleft;
7-
-webkit-animation-duration: 225ms;
8-
-moz-animation-duration: 225ms;
913
}
1014

1115
.slide.in {
1216
-webkit-transform: translateX(0);
13-
-webkit-animation-name: fadein;
17+
-webkit-animation-name: slideinfromright;
1418
-moz-transform: translateX(0);
15-
-moz-animation-name: fadein;
16-
-webkit-animation-duration: 200ms;
17-
-moz-animation-duration: 200ms;
19+
-moz-animation-name: slideinfromright;
1820
}
1921

2022
.slide.out.reverse {
2123
-webkit-transform: translateX(100%);
2224
-webkit-animation-name: slideouttoright;
2325
-moz-transform: translateX(100%);
2426
-moz-animation-name: slideouttoright;
25-
-webkit-animation-duration: 200ms;
26-
-moz-animation-duration: 200ms;
2727
}
2828

2929
.slide.in.reverse {
3030
-webkit-transform: translateX(0);
31-
-webkit-animation-name: fadein;
31+
-webkit-animation-name: slideinfromleft;
3232
-moz-transform: translateX(0);
33-
-moz-animation-name: fadein;
34-
-webkit-animation-duration: 200ms;
35-
-moz-animation-duration: 200ms;
33+
-moz-animation-name: slideinfromleft;
34+
}
35+
36+
@-webkit-keyframes slideinfromright {
37+
from { -webkit-transform: translateX(100%); }
38+
to { -webkit-transform: translateX(0); }
39+
}
40+
@-moz-keyframes slideinfromright {
41+
from { -webkit-transform: translateX(100%); }
42+
to { -webkit-transform: translateX(0); }
43+
}
44+
45+
@-webkit-keyframes slideinfromleft {
46+
from { -webkit-transform: translateX(-100%); }
47+
to { -webkit-transform: translateX(0); }
48+
}
49+
@-moz-keyframes slideinfromleft {
50+
from { -webkit-transform: translateX(-100%); }
51+
to { -webkit-transform: translateX(0); }
3652
}
3753

3854
@-webkit-keyframes slideouttoleft {
@@ -51,4 +67,4 @@
5167
@-moz-keyframes slideouttoright {
5268
from { -moz-transform: translateX(0); }
5369
to { -moz-transform: translateX(100%); }
54-
}
70+
}

js/jquery.mobile.transition.slide.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,19 @@
33
*/
44

55
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
6-
//>>description: Fallback transition for slide in non-3D supporting browsers
7-
//>>label: Slide fallback transition
6+
//>>description: Handler and fallback transition for slide in non-3D supporting browsers
7+
//>>label: Slide handler and fallback transition
88
//>>group: Transitions
99
//>>css: ../css/structure/jquery.mobile.transition.slide.css
1010

1111
define( [ "jquery", "./jquery.mobile.transition" ], function( $ ) {
1212
//>>excludeEnd("jqmBuildExclude");
1313
(function( $, window, undefined ) {
1414

15+
// Use the simultaneous transition handler for slide transitions
16+
$.mobile.transitionHandlers.slide = $.mobile.transitionHandlers.simultaneous;
17+
18+
// Set the slide transition's fallback to "fade"
1519
$.mobile.transitionFallbacks.slide = "fade";
1620

1721
})( jQuery, this );

0 commit comments

Comments
 (0)