Created
November 27, 2010 20:13
-
-
Save cantino/718228 to your computer and use it in GitHub Desktop.
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
class Utilities | |
@findPos: (obj) -> | |
obj = obj.get(0) if obj.html? | |
curLeft = curTop = 0 | |
if obj.offsetParent | |
loop | |
curLeft += obj.offsetLeft | |
curTop += obj.offsetTop | |
break unless obj = obj.offsetParent | |
{ x: curLeft, y: curTop } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment