如题,在比较低端的手机上,存在严重的卡顿现象。PC端毫无感觉。
做的一个很简单循环移动的背景图片。
代码如下:
.animate{
-webkit-animation: reload 30s linear infinite;
-moz-animation: reload 30s linear infinite;
-ms-animation: reload 30s linear infinite;
-o-animation: reload 30s linear infinite;
animation: reload 30s linear infinite;
}
@-webkit-keyframes reload{
from { background-position: 0 0; }
to { background-position: 100% 0; }
}
@-moz-keyframes reload{
from { background-position: 0 0; }
to { background-position: 100% 0; }
}
@-o-keyframes reload{
from { background-position: 0 0; }
to { background-position: 100% 0; }
}
@-ms-keyframes reload{
from { background-position: 0 0; }
to { background-position: 100% 0; }
}
@keyframes reload{
from { background-position: 0 0; }
to { background-position: 100% 0; }
}
小弟动画小白,请问如何解决?
试试加上 -webkit-transform: translate3d(0,0,0); transform: translate3d(0,0,0);
开启GPU硬件加速,一定程度上可以优化动画渲染性能。