【发布时间】:2012-07-12 06:59:48
【问题描述】:
当我使用以下代码使用 CSS3 旋转图形时(这只是 webkit 版本,但在我的样式表中有其他浏览器特定版本)。
.bottomSmallCogStopAnimating {
-webkit-animation-name: rotate;
-webkit-animation-duration: 5000ms;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
}
我正在使用 jQuery 添加这个 css 类,通过删除动画名称来停止动画。
.stopAnimating {
-moz-animation: none;
-webkit-animation: none;
animation: none;
}
删除此属性似乎会将图形重置为其旋转前的状态,所以我看到的是图形弹回其原始旋转状态,这看起来很糟糕。
有没有办法阻止这种情况发生,所以浏览器会记住它的最后位置并在此时停止动画?
干杯, 斯蒂芬
【问题讨论】:
-
我接受纠正,但如果没有 JavaScript,这是不容易做到的。可能有
data-属性的可能性。 -
CSS 动画不是 CSS 过渡。
标签: css css-animations