Javascript & jQuery scroll doesn't work even in console


#1

Hello everyone,

I’m trying to scroll to the top of the page in flowrouter but the scroll doesn’t simply work not even in the console of browser. For example when I put this code inside console of many websites that are using jquery, the page scrolls to the top but in meteor when I put it inside console nothing happens.

jQuery('body, html').animate({scrollTop : 0},800);

and by the way I’m using :
twbs:bootstrap
mouse0270:bootstrap-notify


#2

I’m going to guess that you have a container in your app where your scrollable content is living. Try replacing 'body, html' with the container that you need to scroll?


#3

Thanks, I don’t know why I didn’t try that ! but it solved the problem.