How can I get windowWidth
, windowHeight
, pageWidth
, pageHeight
, screenWidth
, screenHeight
, pageX
, pageY
, screenX
, screenY
which will work in all major browsers?
Javascript – Get the size of the screen, current web page and browser window
cross-browserhtmljavascriptjquerylayout
Related Topic
- Javascript – How to know which radio button is selected via jQuery
- Javascript – Get the current URL with JavaScript
- Javascript – How to get the browser viewport dimensions
- Javascript – How to remove all CSS classes using jQuery/JavaScript
- Javascript – How to get the current date in JavaScript
- Html – How to make a div 100% height of the browser window
- Javascript – Get the current year in JavaScript
- Javascript – Invariant Violation: Objects are not valid as a React child
Best Answer
You can get the size of the window or document with jQuery:
For screen size you can use the
screen
object: