How to get screen position of CSS3-3d transformed elements?

前端 未结 3 1416
小蘑菇
小蘑菇 2020-12-15 08:52

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

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-15 09:12

    Using getBoundingClientRect is a good idea but will only give you the coordinates of the rectangle that contains your shape, not the exact coordinates of the 4 topleft, bottomright, bottomleft, topright corners.

    You'd only be able to do this by taking each of those non-transformed coordinates and applying the transform via javascript.

提交回复
热议问题