Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save webolizzer/87e8f30acaded0aedf10201e80820dba to your computer and use it in GitHub Desktop.
Save webolizzer/87e8f30acaded0aedf10201e80820dba to your computer and use it in GitHub Desktop.
Get the size of the screen, current web page and browser window
// @author http://stackoverflow.com/a/3437825/2337281
$(window).height(); // returns height of browser viewport
$(document).height(); // returns height of HTML document (same as pageHeight in screenshot)
$(window).width(); // returns width of browser viewport
$(document).width(); // returns width of HTML document (same as pageWidth in screenshot)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment