SyntaxFix
Write A Post
Hire A Developer
Questions
Maybe more simple;
var top = window.pageYOffset || document.documentElement.scrollTop, left = window.pageXOffset || document.documentElement.scrollLeft;
Credits: so.dom.js#L492