Last active
August 29, 2015 14:04
-
-
Save adamculpepper/7e286a3c35ba55f7efe5 to your computer and use it in GitHub Desktop.
getBoundingClientRect()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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