translate 和 translate3D 的区别

不定时更新

1.translate3D 可以调用GPU进行3D加速

2.translate 因为是 2D 移动,所以不能调用GPU进行3D加速

3.translate3D 可以在一个 z-axis (Z轴) 方向进行移动,正值会感觉元素离你更近,负值会感觉更远,不像translate只能平移。
https://developer.mozilla.org/zh-CN/docs/Web/CSS/transform-function/translateZ

4.translate 是二个维度的向量
https://developer.mozilla.org/zh-CN/docs/Web/CSS/transform-function/translate

5.translate3D 是三个维度的向量
https://developer.mozilla.org/zh-CN/docs/Web/CSS/transform-function/translate3d

translate3D 和 translate 都有的 X 和 Y 移动:

Y:
https://developer.mozilla.org/zh-CN/docs/Web/CSS/transform-function/translateY

X:
https://developer.mozilla.org/zh-CN/docs/Web/CSS/transform-function/translateX

原文地址:https://www.cnblogs.com/xiaolantian/p/12658469.html