Created
September 10, 2013 15:38
-
-
Save thekarel/6511245 to your computer and use it in GitHub Desktop.
Retrieve an HTML element's position -- From http://stackoverflow.com/questions/442404/retrieve-the-position-x-y-of-an-html-element
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 rect = element.getBoundingClientRect(); | |
console.log(rect.top, rect.right, rect.bottom, rect.left); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment