如何获得CSS3-3d转换元素的屏幕位置? [英] How to get screen position of CSS3-3d transformed elements?
问题描述
我有一个非常复杂的网站建立在CSS3上,具有3d变换,旋转,翻转,翻转和一般扭曲的HTML元素。
找出这些元素之一的屏幕上的位置,并没有看到任何方式这样做。
或者,如果任何人可以解释 -webkit-透视
你试过了吗?使用 getBoundingClientRect()
?
我已经成功地使用它来计算用 transform
属性转换的元素的尺寸。 p>
I have a very complicated site built on CSS3 that has html elements 3d-transformed, rotated, flipped, flopped and just generally distorted.
I'm trying to figure out the on-screen location of one of these elements and don't see any way to do so. I was wondering if anyone has any ingenious ideas.
Alternatively, if anyone can explain the math behind -webkit-perspective
, I can figure out the position as that's the only thing I'm not sure how to model.
Have you tried using getBoundingClientRect()
?
I've used it successfully in the past to calculate the dimensions of elements that have been transformed with the transform
property.
这篇关于如何获得CSS3-3d转换元素的屏幕位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!