脚本宝典收集整理的这篇文章主要介绍了Css3实现无缝滚动防抖,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
问题
图片加文字的无缝滚动,在手机端的效果总体还行,但是图片在手机某些浏览器会抖得腻害!
错误写法
不能用left,margin-left,像这种写法:
.donghua.active{ animation: scoll ease-in-out 1s infinITe alternate; -webkit-animation: scoll ease-in-out 1s infinite alternate; } @keyframes scoll { From { left: 0; } to { left: -353px; } } -webkit-@keyframes scoll { from { left: 0; } to { left: -353px; } }
解决方法
里面的某个元素在手机端会抖动的腻害,改用二维的translate像这样:
.donghua.active{ animation: scoll ease-in-out 1s infinite alternate; -webkit-animation: scoll ease-in-out 1s infinite alternate; } @keyframes scoll { 0% { transform: translate(0px, 0px); } 100% { transform: translate(0px, -353px); } } @-webkit-keyframes scoll { 0% { transform: translate(0px, 0px); } 100% { transform: translate(0px, -353px); } }
以上就是Css3实现无缝滚动防抖的详细内容,更多关于CSS3 无缝滚动 防抖的资料请关注脚本宝典其它相关文章!
以上是脚本宝典为你收集整理的Css3实现无缝滚动防抖全部内容,希望文章能够帮你解决Css3实现无缝滚动防抖所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。