scrollTop method


I suspect there is a probame with the method scrollTop in google chrome.

why when i open this fiddle page on safari the code is working and on chrome it doesn’t?



Use document instead of "body":


thanks @ghukahr !

any idea why body doesn’t work?

Not sure, lots of differences between browsers, must be to make our life’s harder :sleepy:

I think there’s even more support to use window instead of document, but in any case it’s better to test in every browser and OS.

1 Like