function scroll() { var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; var scrollLeft = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0; var o = {}; o.top = scrollTop; o.left = scrollLeft; return o; }