How can I get windowWidth
, windowHeight
, pageWidth
, pageHeight
, screenWidth
, screenHeight
, pageX
, pageY
, screenX
, screenY
which will work in all major browsers?
JavaScript Screen Size – How to Get the Size of the Screen, Web Page, and Browser Window
cross-browserhtmljavascriptjquerylayout
Best Answer
These days, for screen size you can use the
screen
object:Legacy
You can get the size of the window or document with jQuery: