Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css Can';不要在最后一帧停止动画_Css_Animation_Keyframe - Fatal编程技术网

Css Can';不要在最后一帧停止动画

Css Can';不要在最后一帧停止动画,css,animation,keyframe,Css,Animation,Keyframe,我试图播放一个角色跳跃动画,我想在最后一帧停止,但它没有停止。我试着用 动画填充模式:正向 没有结果 下面是我正在使用的代码 .kia-jump { width: 320px; height: 464px; position: absolute; top: 1%; left: 41%; background: url('../images/activity/KiaJumpingAnimation.png') left center; ani

我试图播放一个角色跳跃动画,我想在最后一帧停止,但它没有停止。我试着用

动画填充模式:正向

没有结果

下面是我正在使用的代码

.kia-jump {
    width: 320px;
    height: 464px;
    position: absolute;
    top: 1%;
    left: 41%;
    background: url('../images/activity/KiaJumpingAnimation.png') left center;
    animation-fill-mode: forwards;
    animation: jumpAnim 1.67s steps(24) 1;
}

@keyframes jumpAnim {
    100% { background-position: -7920px; }
}

这里是指向JSFIDLE->

的链接,实际上您还有一个额外的步骤,由于默认情况下您的
背景设置为
repeat
,因此只需返回到最后的第一帧

.kia-jump {
    width: 320px;
    height: 464px;
    position: absolute;
    top: 1%;
    left: 41%;
    background: url('http://schoolcinema-sconline.rhcloud.com/images/activity/KiaJumpingAnimation.png') left center;
    animation: jumpAnim 1.67s steps(23) 1 forwards;
}

@keyframes jumpAnim {
    100% { background-position: -7590px; }
}
刚刚

7920-(7920/24)=7590


只需打开动画:jumpAnim 1.67s steps(24)1forwards@PaoloCargnin我想你是对的。动画是一种速记,所以之前的设置很有可能会被覆盖。@PaoloCargnin不起作用:(效果很好..你是摇滚明星;)谢谢你的帮助。。我累了,跟在“前锋”后面跑: