Gets the element relative to the window?

Scene: How to get the element relative to the window?

Measures: object.getBoundingClientRect (); the elements will be top, right, bottom, left, width, height properties that return by way of an object.

Guess you like

Origin www.cnblogs.com/juicy-initial/p/11517843.html