How can I get windowWidth, windowHeight, pageWidth, pageHeight, screenWidth, screenHeight, pageX, pageY, screenX, screenY which will work in all major browsers?
windowWidth
windowHeight
pageWidth
pageHeight
screenWidth
screenHeight
pageX
pageY
screenX
screenY
You can get the size of the window or document with jQuery:
// Size of browser viewport. $(window).height(); $(window).width(); // Size of HTML document (same as pageHeight/pageWidth in screenshot). $(document).height(); $(document).width();
For screen size you can use the screen object:
screen
window.screen.height; window.screen.width;
2.1m questions
2.1m answers
60 comments
57.0k users