Created
April 17, 2019 21:40
-
-
Save dkdndes/ed289eaa4651efe887f545dd4cf6aff4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function findPosX(obj) { | |
var curleft = 0; | |
if (obj.offsetParent) { | |
while (obj.offsetParent) { | |
curleft += obj.offsetLeft - ((isOpera) ? 0 : obj.scrollLeft); | |
obj = obj.offsetParent; | |
} | |
// IE offsetParent does not include the top-level | |
if (isIE && obj.parentElement){ | |
curleft += obj.offsetLeft - obj.scrollLeft; | |
} | |
} | |
else if (obj.x) { | |
curleft += obj.x; | |
} | |
return curleft; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment