Page width and height:
Document. Body. clientwidth/height (excluding margin)
Document. Body. offsetwidth/height (excluding margin)
Document. Body. scrollwidth/height (including margin)
TIPS:
1. if the browser window is not maximized and Min-width, document. body. offsetwidth is later than document. body. 2 PX more clientwidth, which is the 2px space next to the scroll bar.
2. Sometimes, overflow: hidden is not set; the image will support the page width. In this case, the page width value with a horizontal scroll bar is incorrect.
Window viewport width and height:
Window. innerwidth/height (with a scroll bar)
Document.doc umentelement. clientwidth/height (without a scroll bar)
Element width and height:
Element. offsetwidth/height (width + padding + Border)
Element. scrollwidth/height (width + padding, Without Border)
Element location:
Page width and height, window width and height, element width and height, element location, Page scrolling distance