Skip to content

Instantly share code, notes, and snippets.

@jbutko
Created April 5, 2014 20:58
Show Gist options
  • Save jbutko/9998026 to your computer and use it in GitHub Desktop.
Save jbutko/9998026 to your computer and use it in GitHub Desktop.
javaScript: Get position in viewport coordinates
element.getBoundingClientRect(); // Get position in viewport coordinates
// From http://stackoverflow.com/questions/1567327/using-jquery-to-get-elements-position-relative-to-viewport
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment