回到初始风格时的Css动画

use*_*232 0 html javascript css jquery animation

我在图像上有缩放动画,但是当动画完成并回到初始大小时没有动画,我怎样才能在回到初始值时强制动画?

http://jsbin.com/tijapahuwi/edit?html,css,output

@keyframes scaleImg {
    from {
        transform: scale(0.8);
    }
    to {
        transform: scale(1);
    }
}

img { 
   transform: scale(0.8);
   animation: scaleImg 1.5s;
   animation-direction: alternate;
}



<img src="http://lorempixel.com/400/200/sports/" alt="">
Run Code Online (Sandbox Code Playgroud)

Jar*_*a X 6

animation-direction: alternate; 是一个好的开始

每次迭代都以交替方向运行

所以,2次迭代回到你开始的地方 - 即

animation-iteration-count: 2;
Run Code Online (Sandbox Code Playgroud)

当然,如果你想用的总时间是1.5秒,你会想要改变1.5s到750ms以及