制作一个滚动的金币,随着页面加载,完成一个两个过程的动画,第一步逐渐旋转变大,到达第一个位置后,留下一个动画留影,第二步继续移动,到达第二个位置后,留下一个动画留影,结束动画。2.我尝试过使用定时器,判定定位的left来进行留影,但是效果并不好,没有流畅感,而且无法解决,逐渐旋转变大的特效。3.截图
1 回答

慕森卡
TA贡献1806条经验 获得超8个赞
试试这个@keyframes,这个是菜鸟教程的地址
例子如下,和他差不多吧
@keyframes myfirst { 0% {background: red; left:0px; top:0px;} 25% {background: yellow; left:200px; top:0px;} 50% {background: blue; left:200px; top:200px;} 75% {background: green; left:0px; top:200px;} 100% {background: red; left:0px; top:0px;} } @-webkit-keyframes myfirst /* Safari and Chrome */ { 0% {background: red; left:0px; top:0px;} 25% {background: yellow; left:200px; top:0px;} 50% {background: blue; left:200px; top:200px;} 75% {background: green; left:0px; top:200px;} 100% {background: red; left:0px; top:0px;} }
添加回答
举报
0/150
提交
取消