Please help. . I just encountered a problem about the adaptation of document.documentElement.scrollTop and document.body.scrollTop. I read online that document.documentElement.scrollTop is used in standard mode. . But why do I test that the value of document.documentElement.scrollTop is always 0 in HTML5 standard mode, while document.body.scrollTop has a value?
ringa_lee2017-07-05 10:43:05
Browser compatibility issue.
It is recommended to write let top = document.documentElement.scrollTop || document.body.scrollTop