When trying to find out how much a web page has been scrolled from the top, which of these should one use:
document.body.scrollTop
,
document.documentElement.scrollTop
,
window.pageYOffset
,
window.scrollY
Which one(s) would I choose in these 2 separate scenarios:
a) If I wanted maximum compatibility (across the main browsers used currently)?
b) If I wanted code that was most standards compliant/future-proof/strict-mode-compatible (but didn't care about supporting old/non-standard browsers)?