1

I want that my homepage window to be always scrolled all the way up when I refresh the page. I know that chrome saves the scrolling state in the history and changes it on page load. I was wondering if there is a way to do that properly. So far the workaround I found is something like:

angular.element(window).bind('load',function (){
    $timeout(function(){
     scroller.scrollTo(0, 0, 1000);
    },200);
  });

Which is really a smooth scroll up transition. If I set the timing to 0, it will be too glitchy. The ideal way would be to overwrite the standard behaviour before page load but I did not find any way to do it...

PS: Please no jQuery solution.

Alex C
  • 1,334
  • 2
  • 18
  • 41
  • Did you do any research? Just on SO, there are several posts about this. Apparently no solution was found other than the onload/timeout/JS scroll hack. http://stackoverflow.com/questions/15355839/how-to-let-the-chrome-forget-the-page-scroll-position | http://stackoverflow.com/questions/16239520/chrome-remembers-scroll-position | http://stackoverflow.com/questions/18617367/disable-browers-auto-scroll-after-a-page-refresh – marekful Mar 07 '14 at 20:40
  • @MarcellFülöp The solution I provide is the result of my research. I would also add: http://stackoverflow.com/questions/21197228/angularjs-browser-back-button-go-back-to-previous-spot-on-page which has hints that it's doable but I am still missing information to do it. – Alex C Mar 07 '14 at 20:48

0 Answers0