These are two iframes with width 300 and height 100. You can play with them to see how the scrolling properties are measured.

backwards compatible mode

strict mode

document.documentElement.scrollLeft document.documentElement.scrollLeft
document.documentElement.scrollTop document.documentElement.scrollTop
document.body.scrollLeft document.body.scrollLeft
document.body.scrollTop document.body.scrollTop
window.pageXOffset window.pageXOffset
window.pageYOffset window.pageYOffset
window.scrollX window.scrollX
window.scrollY window.scrollY