javascript - Scroll a container on initial load in an Angular app -
i have container animates scrolltop bottom whenever new item added. markup looks this:
<div class="scrolly"> <div class="item" ng-repeat="item in items" ng-animate=" 'scroll-to-bottom' "> {{item.value}} </div> </div>
this works great when adding new items, on initial page load, container scrolled top. i'd figure out right way have scrolltop set bottom on initial page load.
example jsfiddle: http://jsfiddle.net/bkad/jnwcp/
the trick add delay when populate data :)
$timeout(function () { (var = 0; < 20; i++) $scope.items.push({ value: }) }, 10);
Comments
Post a Comment