【发布时间】:2020-02-27 19:17:00
【问题描述】:
我需要创建一个无限循环的图像动画,例如超级马里奥背景,其中图像的结尾附加到同一图像的开头,给人一种图像永远不会结束的感觉,但是使用 css关键帧。
到目前为止,我已经做到了这一点,但这只会使图像来回移动。
我怎样才能做到这一点?
.waves {
height: 320px;
width: 700px;
position: relative;
top: -325px;
background-repeat: repeat-x;
animation: animatedImage 5s linear infinite;
}
@keyframes animatedImage {
0% { left: 0;}
50%{ left : 500px;}
100%{ left: 0;}
}
【问题讨论】:
-
你能在代码 sn-p 或 fiddle 中重现问题吗?
标签: javascript css css-animations keyframe