本文介绍了什么是-webkit-transform:translate3d(0,0,0);准确吗?适用于身体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

-webkit-transform:translate3d(0,0,0); 究竟做了什么?
它有任何性能问题吗?我应该把它应用到身体还是个别元素?它似乎改进滚动事件剧烈。

what does -webkit-transform: translate3d(0,0,0); exactly do?Does it have any performance issues? Should I just apply it to the body or individual elements? It seems to improve scroll events drastically.

感谢您的参与!

推荐答案

-webkit-transform:translate3d(0,0,0); 使一些设备运行其硬件加速。

-webkit-transform: translate3d(0,0,0); makes some devices run their hardware acceleration.

使用 -webkit-transform:translate3d(0,0,0); 会使GPU转换为CSS转换的动作,使它们更平滑)。

Using -webkit-transform: translate3d(0,0,0); will kick the GPU into action for the CSS transitions, making them smoother (higher FPS).

注意: translate3d(0,0,0)你看到的术语。它在x,y和z轴上将对象移动0px。

Note: translate3d(0,0,0) does nothing in terms of what you see. it moves the object by 0px in x, y and z axis. It's only a technique to force the hardware acceleration.

另一种方法是 -webkit-transform: translateZ(0)。如果Chrome和Safari由于转换而闪烁,请尝试 -webkit-backface-visibility:hidden -webkit-perspective:1000 。有关详情,请参阅。

An alternative is -webkit-transform: translateZ(0). And If there's flickering on Chrome and Safari due to transforms, try -webkit-backface-visibility: hidden and -webkit-perspective: 1000. For more info refer to this article.

这篇关于什么是-webkit-transform:translate3d(0,0,0);准确吗?适用于身体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 18:39