We use jquery to develop the process we sometimes based on the location of the browser window, the following explains some ways to get the browser window size.
Browser viewable area size, note that this refers not to the browser window size, nor the page size, we can imagine that we can see the size of the document area
- The viewable area height in the current browser window: $ (window). Height ()
- The width of the viewable area in the current browser window: $ (window). Width ()
Browser size of the entire document
- The height of the current document: $ (document). Height ()
- The width of the current document: $ (documents). Width ()
browser window document body
- The height of the body of the window document: $ (document.body). Height ()
- Window Document Body width: $ (document.body). Width ()
Window document body Total height, total width (including padding, border, margin)
- The total height of the body of the window document (including padding, border, margin): $ (document.body). Outerheight (True)
- The total width of the body of the window document (including padding, border, margin): $ (document.body). Outerwidth (True)
Scroll bar correlation value gets
- The distance from the top of the scroll bar: $ (document). ScrollTop ()
- The distance from the scroll bar to the left: $ (document). ScrollLeft ()
Query Gets the height and width of the browser window