Scroll to top of div in AngularJS?

I am using AngularJS for a small web app and have encountered a problem. I am using ng-repeat to populate a list inside of a div. The div has a fixed height and is set to overflow-y: auto, meaning a scroll bar appears when the list is too big for the div. My problem is that when the list gets re-drawn, i.e. the data backing ng-repeat changes, the scroll bar does not reset to the top of the div. Instead, it stays at whatever position the scroll bar was at before the ng-repeat change. This is a very poor user experience. I’ve tried the following without any luck:

How to expand and collapse three div’s side by side?

The question: $(document).ready(function () { $(“#toggle”).click(function () { if ($(this).data(‘name’) == ‘show’) { $(“#sidebar”).animate({ width: ‘10%’ }).hide() $(“#map”).animate({ width: ‘89%’ }); $(this).data(‘name’, ‘hide’) } else { $(“#sidebar”).animate({ width: ‘29%’ }).show() $(“#map”).animate({ width: ‘70%’ }); $(this).data(‘name’, ‘show’) } }); }); html, body { width:100%; height: 100%; } #header { width: 100%; height: 20%; float: left; border: … Read more