getBBox() vs getBoundingClientRect() vs getClientRects()

后端 未结 3 1374
猫巷女王i
猫巷女王i 2021-02-01 01:36

I am unable to find an explicit reference for the use of these functions: getBBox() vs getBoundingClientRect() vs getClientRects().

<
3条回答
  •  粉色の甜心
    2021-02-01 02:15

    some elements(like span tag) will have multiple ClientRects when they are wrapped into multiple lines.MDN Element.getClientRects()
    and a BoundingRect is the union of ClientRects of a element.MDN Element.getBoundingClientRect()

提交回复
热议问题