Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i reverse a CSS3 animation on the first iteration (and not the second)

I have setup a CSS3 animation like this:

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

How do i reverse this animation on a class definition?

For example:

.slideinTransition {
    -webkit-animation-name: slidein;
    -webkit-animation-direction: alternate;
}

This will reverse the animation on the second iteration, i would like to reverse it directly on the first iteration.

like image 709
denicio Avatar asked Mar 31 '11 12:03

denicio


1 Answers

Try this:

-webkit-animation-direction: alternate-reverse;
like image 153
Roland Kákonyi Avatar answered Oct 26 '22 23:10

Roland Kákonyi