The width and height of $ (window) and $ (document) are consistent when there is no vertical scroll bar
When there is a vertical scrollbar, the width of $ (window) and $ (document) match the height of the window to the height of the viewable area, and document is the height of the entire HTML document (including the margin padding border is total)
The width and height of $ (window) and $ (document) are consistent when there is no horizontal scroll bar
The height of $ (window) and $ (document) are consistent when there is a horizontal scroll bar
Window width is the width of the viewable area, document is the width of the entire HTML document (including margin padding border is total)
Summarize:
1. The vertical and horizontal scroll bars do not have the case of $ (window). Width () and $ (document). Width (), $ (window). Height () is consistent with $ (document). Height ()
2. When the vertical and horizontal scrollbars exist or exist at the same time, the width or height of the window is always the width or height of the viewable area (excluding the width height of the scrollbar), while the document documents are always the actual width or height of the page document (including beyond the viewable area)
jquery under the width, height method of $ (window) and $ (document) is worth distinguishing