javascript - Get the size of the screen, current web page and browser window -
how can windowwidth, windowheight, pagewidth, pageheight, screenwidth, screenheight, pagex, pagey, screenx, screeny work in major browsers?

if using jquery, can size of window or document using jquery methods:
$(window).height(); // returns height of browser viewport $(document).height(); // returns height of html document (same pageheight in screenshot) $(window).width(); // returns width of browser viewport $(document).width(); // returns width of html document (same pagewidth in screenshot) for screen size can use screen object in following way:
screen.height; screen.width;
Comments
Post a Comment