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); 

demo


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -