【发布时间】:2015-01-13 17:42:01
【问题描述】:
我有以下代码为元素的背景位置设置动画以创建关键帧动画。它是 12 帧,图像是 1536px。
但是,即使我有 -webkit-animation-fill-mode: forwards;,动画也会在最后重置回第一帧...我该如何停止呢?
HTML:
<div class="sequence animate"></div>
CSS:
div.sequence
{
width: 128px;
height: 128px;
background: url('./img/sequence.png');
}
div.sequence.animate
{
-webkit-animation: boxopen 4s steps(12);
-webkit-animation-fill-mode: forwards;
}
@-webkit-keyframes boxopen {
from {background-position: 0;}
to {background-position: -1536px;}
}
【问题讨论】:
-
我不确定这是否是您想要的。
-
啊!我的错。我想你想在最后一个关键帧停止它。
标签: html css css-animations