Scroll to in angularjs

前端 未结 5 481
半阙折子戏
半阙折子戏 2021-01-31 09:04

I am trying to scroll to an element on the page after I \'show\' it. I.E. i have a very long list of users and I display them as a list. Each element has an edit icon you can

5条回答
  •  南方客
    南方客 (楼主)
    2021-01-31 09:26

    I found that if I wanted to scroll to a particular element, I wasn't interested in updating the url to show what Id I was going to (e.g. #admin-form id in www.something.com/#admin-form)

    So to scroll without updating the url I found you could just call anchorscroll without needing to update the location hash.

    $anchorScroll('admin-form');
    

提交回复
热议问题