Problem: In some cases, Chrome doesn’t recognize document.documentElement.scrollTop — it returns a value in IE and FF, but it’s 0 in Chrome.
Solution: In that case, use: document.documentElement.scrollTop + document.body.scrollTop
Further reading: The two browser modes: quirks mode and strict mode Activating Browser Modes with Doctype