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?

screenshot describing values wanted

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

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -