Skip to content

Commit 4bed2c7

Browse files
author
Atul Varma
committed
Added basic support for css transitions in Firefox 5 for desktop and mobile. The flip transition doesn't work yet, but the others do, as does the loading animation.
1 parent 5ed85a8 commit 4bed2c7

File tree

3 files changed

+180
-3
lines changed

3 files changed

+180
-3
lines changed

js/jquery.mobile.navigation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@
485485
//animation complete callback
486486
$.fn.animationComplete = function( callback ) {
487487
if( $.support.cssTransitions ) {
488-
return $( this ).one( 'webkitAnimationEnd', callback );
488+
return $( this ).one( ($.browser.webkit ? 'webkitAnimationEnd' : 'animationend'), callback );
489489
}
490490
else{
491491
// defer execution for consistency between webkit/non webkit

js/jquery.mobile.support.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ $.mobile.browser.ie = ( function() {
6060
$.extend( $.support, {
6161
orientation: "orientation" in window,
6262
touch: "ontouchend" in document,
63-
cssTransitions: "WebKitTransitionEvent" in window,
63+
cssTransitions: "WebKitTransitionEvent" in window || "TransitionEvent" in window,
6464
pushState: !!history.pushState,
6565
mediaquery: $.mobile.media( "only all" ),
6666
cssPseudoElement: !!propExists( "content" ),

themes/default/jquery.mobile.transitions.css

Lines changed: 178 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,4 +262,181 @@ Built by David Kaneda and maintained by Jonathan Stark.
262262
-webkit-transform: scale(.2);
263263
opacity: 0;
264264
}
265-
}
265+
}
266+
267+
/* Gecko equivalents */
268+
269+
.spin {
270+
-moz-transform: rotate(360deg);
271+
-moz-animation-name: spin;
272+
-moz-animation-duration: 1s;
273+
-moz-animation-iteration-count: infinite;
274+
}
275+
@-moz-keyframes spin {
276+
from {-moz-transform: rotate(0deg);}
277+
to {-moz-transform: rotate(360deg);}
278+
}
279+
280+
.in, .out {
281+
-moz-animation-timing-function: ease-in-out;
282+
-moz-animation-duration: 350ms;
283+
}
284+
285+
.slide.in {
286+
-moz-transform: translateX(0);
287+
-moz-animation-name: slideinfromright;
288+
}
289+
290+
.slide.out {
291+
-moz-transform: translateX(-100%);
292+
-moz-animation-name: slideouttoleft;
293+
}
294+
295+
.slide.in.reverse {
296+
-moz-transform: translateX(0);
297+
-moz-animation-name: slideinfromleft;
298+
}
299+
300+
.slide.out.reverse {
301+
-moz-transform: translateX(100%);
302+
-moz-animation-name: slideouttoright;
303+
}
304+
305+
.slideup.in {
306+
-moz-transform: translateY(0);
307+
-moz-animation-name: slideinfrombottom;
308+
}
309+
310+
.slideup.out {
311+
-moz-animation-name: dontmove;
312+
}
313+
314+
.slideup.out.reverse {
315+
-moz-transform: translateY(100%);
316+
-moz-animation-name: slideouttobottom;
317+
}
318+
319+
.slideup.in.reverse {
320+
-moz-animation-name: dontmove;
321+
}
322+
.slidedown.in {
323+
-moz-transform: translateY(0);
324+
-moz-animation-name: slideinfromtop;
325+
}
326+
327+
.slidedown.out {
328+
-moz-animation-name: dontmove;
329+
}
330+
331+
.slidedown.out.reverse {
332+
-moz-transform: translateY(-100%);
333+
-moz-animation-name: slideouttotop;
334+
}
335+
336+
.slidedown.in.reverse {
337+
-moz-animation-name: dontmove;
338+
}
339+
340+
@-moz-keyframes slideinfromright {
341+
from { -moz-transform: translateX(100%); }
342+
to { -moz-transform: translateX(0); }
343+
}
344+
345+
@-moz-keyframes slideinfromleft {
346+
from { -moz-transform: translateX(-100%); }
347+
to { -moz-transform: translateX(0); }
348+
}
349+
350+
@-moz-keyframes slideouttoleft {
351+
from { -moz-transform: translateX(0); }
352+
to { -moz-transform: translateX(-100%); }
353+
}
354+
355+
@-moz-keyframes slideouttoright {
356+
from { -moz-transform: translateX(0); }
357+
to { -moz-transform: translateX(100%); }
358+
}
359+
360+
361+
@-moz-keyframes slideinfromtop {
362+
from { -moz-transform: translateY(-100%); }
363+
to { -moz-transform: translateY(0); }
364+
}
365+
366+
@-moz-keyframes slideinfrombottom {
367+
from { -moz-transform: translateY(100%); }
368+
to { -moz-transform: translateY(0); }
369+
}
370+
371+
@-moz-keyframes slideouttobottom {
372+
from { -moz-transform: translateY(0); }
373+
to { -moz-transform: translateY(100%); }
374+
}
375+
376+
@-moz-keyframes slideouttotop {
377+
from { -moz-transform: translateY(0); }
378+
to { -moz-transform: translateY(-100%); }
379+
}
380+
@-moz-keyframes fadein {
381+
from { opacity: 0; }
382+
to { opacity: 1; }
383+
}
384+
385+
@-moz-keyframes fadeout {
386+
from { opacity: 1; }
387+
to { opacity: 0; }
388+
}
389+
390+
.fade.in {
391+
-moz-animation-name: fadein;
392+
}
393+
.fade.out {
394+
-moz-animation-name: fadeout;
395+
}
396+
397+
/* Hackish, but reliable. */
398+
399+
@-moz-keyframes dontmove {
400+
from { opacity: 1; }
401+
to { opacity: 1; }
402+
}
403+
404+
.pop {
405+
-moz-transform-origin: 50% 50%;
406+
}
407+
408+
.pop.in {
409+
-moz-transform: scale(1);
410+
-moz-animation-name: popin;
411+
}
412+
413+
.pop.out.reverse {
414+
-moz-transform: scale(.2);
415+
-moz-animation-name: popout;
416+
}
417+
418+
.pop.in.reverse {
419+
-moz-animation-name: dontmove;
420+
}
421+
422+
@-moz-keyframes popin {
423+
from {
424+
-moz-transform: scale(.2);
425+
opacity: 0;
426+
}
427+
to {
428+
-moz-transform: scale(1);
429+
opacity: 1;
430+
}
431+
}
432+
433+
@-moz-keyframes popout {
434+
from {
435+
-moz-transform: scale(1);
436+
opacity: 1;
437+
}
438+
to {
439+
-moz-transform: scale(.2);
440+
opacity: 0;
441+
}
442+
}

0 commit comments

Comments
 (0)