I\'m trying to animate while scrolling but no luck with my code...
I have this jquery
$(window).scrollTop(200);
Now wanted to give
I'm using Angular and was trying to scroll down to an item that had been added in an ng-repeat. I put this code inside a $timeout
(with zero time, just to make it happen after the elements displayed) and this was sufficient for the new item to have an offset().top
...
...but I think there was just way too much going on adding dozens of new elements, so it didn't have the processing power to scroll-animate. When I set the timeout time to 1 second, it worked (though it actually took 7 seconds before the timeout got called).
I concluded that animated, smooth scrolling won't really be tractable here, and instead I'm just using
document.body.scrollTop = entry.offset().top