getclientRects:
  • 返回的是clientRect的列表

getBBox:
  • 只对svg元素有效。
  • 进行transform变化后,getbbox的值不会变。但是getboundingclientrect的值会随着变化。

object.getBoundingClientRect()
  • The returned value is a DOMRect object which is the union of the rectangles returned by getClientRects() for the element, i.e., the CSS border-boxes associated with the element.

  • If you need the bounding rectangle relative to the top-left corner of the document, just add the current scrolling position to the top and left properties (these can be obtained using window.scrollX and window.scrollY) to get a bounding rectangle which is independent from the current scrolling position.
    • top + window.scrollY
  •  window.pageXOffset and window.pageYOffset

getBoundingClientRect和getClientRect区别/getBBox

2019-02-18 00:18:47 0 6
这里是评论

相关推荐