I want to auto-scroll to a certain point on a page marked by an id. The problem is that once it scrolls to that point, I can’t scroll back up to the top of the page manually. The anchor becomes the new top of the page.
Does anybody know how to escape this problem?
Here is my code.
$location.hash("p132"); var handle = $ionicScrollDelegate.$getByHandle('content'); handle.anchorScroll(true);
I am also getting the following warning on my console. I already have it wrapped in a timeout as well.
Delegate for handle “content” could not find a corresponding element with delegate-handle=“content”! anchorScroll() was not called!
Possible cause: If you are calling anchorScroll() immediately, and your element with delegate-handle=“content” is a child of your controller, then your element may not be compiled yet. Put a $timeout around your call to anchorScroll() and try again.