AngularJS + Safari: Force page to scroll to top when pages switch

后端 未结 9 1899
深忆病人
深忆病人 2021-02-07 00:20

I am having an odd, safari-only scrolling behavior using AngularJS.

Whenever the user flips between pages, the pages are being changed as if they are AJAX. I understand

9条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-07 00:48

    $window.scrollTo(0,0) will scroll to the top of the page.

    I just found a nice plugin (pure angularJS) that supports animations also:

    https://github.com/durated/angular-scroll

提交回复
热议问题