【发布时间】:2012-12-21 06:53:02
【问题描述】:
可能重复:
Webkit CSS Animation issue - persisting the end state of the animation?
我想在动画 div 完成运行后保持其位置。现在我在鼠标悬停时为 div 设置动画,但即使我仍然悬停在它上面,div 也会返回到它的位置。
有没有办法让它只有在我鼠标移开时才能恢复?
http://jsfiddle.net/neoswf/X5a64/
div{
width:100px;height:100px;margin:1em;background:red
}
div:hover {
-webkit-animation-name: rotateThis;
-webkit-animation-duration:1s;
-webkit-animation-iteration-count: 1;
-webkit-animation-timing-function:ease-in-out;
-webkit-transform: translateZ(0);
}
@-webkit-keyframes rotateThis {
from { -webkit-transform:scale(1) rotate(0deg); }
to { -webkit-transform:scale(1.1) rotate(100deg); }
}
【问题讨论】:
标签: css css-animations