scrollTop method

Hello

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?

thanks

links

http://jsfiddle.net/ASmarterWayToLearn/h6skc763/

http://jsfiddle.net/ASmarterWayToLearn/kjzw24ng/

Use document instead of "body":

$(document).scrollTop(windowHeight);

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