Skip to content

Instantly share code, notes, and snippets.

@adamculpepper
Last active August 29, 2015 14:04
Show Gist options
  • Save adamculpepper/7e286a3c35ba55f7efe5 to your computer and use it in GitHub Desktop.
Save adamculpepper/7e286a3c35ba55f7efe5 to your computer and use it in GitHub Desktop.
getBoundingClientRect()
var sel = $("selector");
var coords = sel[0].getBoundingClientRect();
// Usage
console.log(coords.top);
console.log(coords.bottom);
console.log(coords.left);
console.log(coords.right);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment