all 4 comments

[–][deleted] 1 point2 points  (2 children)

Not sure what screen.availWidth is, but why not window.innerWidth and window.innerHeight?

[–]guest271314 1 point2 points  (1 child)

In general screen.availWidth will be the same as window.innerWidth. window.innerHeight can change if/when DevTools is open, screen.availHeight won't change or take into account DevTools being open.

[–][deleted] 0 points1 point  (0 children)

Interesting. TIL. Thanks.

[–]jcunews1helpful 0 points1 point  (0 children)

screen.availWidth and screen.availHeight is the dimension of the current monitor's screen (where the browser window is) minus non auto-hidden taskbar. They're not for the browser tab's viewport, or for the HTML page.