Get the width and height of the visible area of the window

code:

var w = document.documentElement.clientWidth
var h = document.documentElement.clientHeight

document.documentElement.clientWidth

Gets the width of the document display area of ​​the browser window, excluding scroll bars.

document.documentElement.clientHeight

Gets the height of the document display area of ​​the browser window, excluding scroll bars.

Guess you like

Origin blog.csdn.net/qq_52421092/article/details/130071185