开发者

how to stop CSS animation without javascript

开发者 https://www.devze.com 2023-04-10 02:58 出处:网络
This is the jsFiddle. What I would like is stop the box when it reaches its end position. I know there is a transition function available also but that does not seem to work. Are all animation functio

This is the jsFiddle. What I would like is stop the box when it reaches its end position. I know there is a transition function available also but that does not seem to work. Are all animation functions type also available for transition? I am using rotate funct开发者_如何转开发ion in my actual work.


Just set animation-iteration-count to 1. A value of infinite causes the animation to be repeated infinitely. And remember to style the object the way it should be AFTER the animation (top: 200px;).

I've updated the fiddle: http://jsfiddle.net/nTG42/2/

More information is provide by the MDN: https://developer.mozilla.org/en/css/css_animations


Remove the infinite from animation:mymove infinite; and set the final place as top:200px. Demo

0

精彩评论

暂无评论...
验证码 换一张
取 消