webapi in three families

Three families

1.offset series (read-only attribute can not be set, only to get)

offsetWidth / offsetHeight get the elements of true width and height

offsetLeft / offsetTop there is positioned a distance to the nearest parent element (the offsetParent) of

offsetParent recent positioning of the parent element

 

2.scroll series

scrollWidth, scrollHeight content acquired width and height of the box

scrollLeft scrollTop Get horizontal scroll, vertical scroll distance

window.onscroll scroll event registration, attention is registered to the window

Added: Gets the width and height of the page curl

Window.pageYOffset

Window.pageXOffset

 

3.client series

clientWidth, clientHeight acquired content + padding of size, generally used less

clientLeft,clientTop

 

Added: event triggered when resizing the window (the event is registered to the window)

Window.onresize

Gets the size of the viewing window

window.innerWidth

window.innerHeight

Guess you like

Origin www.cnblogs.com/z-lin/p/11088377.html