Skip to content

Instantly share code, notes, and snippets.

@adunkman adunkman/excerpt.md
Created Jul 3, 2013

Embed
What would you like to do?

Taken from element.getBoundingClientRect MDN documentation:

For cross-browser compatibility, use window.pageXOffset and window.pageYOffset instead of window.scrollX and window.scrollY, except use (((t = document.documentElement) || (t = document.body.parentNode)) && typeof t.ScrollLeft == 'number' ? t : document.body).ScrollLeft and (((t = document.documentElement) || (t = document.body.parentNode)) && typeof t.ScrollTop == 'number' ? t : document.body).ScrollTop when window.pageXOffset and window.pageYOffset (and window.pageXOffset and window.pageYOffset) are undefined.

Oye.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.