Home >Web Front-end >JS Tutorial >document.documentElement && document.documentElement.scrollTop_javascript技巧
In standard browsers, there are things you need to pay attention to, such as double-clicking to automatically scroll
var diffY;
if (document.documentElement && document.documentElement.scrollTop)
diffY = document.documentElement.scrollTop;
else if (document.body)
diffY = document.body .scrollTop
else
{/*Netscape stuff*/}