其实就是让一个箭头图片让他上下移动,在ios上上下移动距离很小,而且位置也偏移到下面了,代码如下
.arrow{
position:absolute;
width:0.92rem;
height:0.3rem;
bottom: 0.8rem;
left:35%;
animation: updown 1.5s ease infinite alternate;
}
@keyframes updown{
from{
bottom:0.8rem;
/*transform: translateY(0.15rem);*/
}
to{
bottom:0.6rem;
/*transform: translateY(0);*/
}
}
最近也遇到这个问题,怀疑是ios上webkit浏览器都有的问题,ios上firefox浏览器也表现正常。
情况是首页加载的keyframes动画,使用了rem单位,有时候会异常(感觉像是keyframes计算ram时获取根节点字体大小不正确,导致的距离缩短)。
解决方法
使用setTimeout(fn,0),利用js单线程的特性,将加载动画class放在线程最后执行,从而使动画表现正常。
代码如下: