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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM