We are using scrollTo functionality in ionic application by setting the $location.hash(id)
and $anchorScroll()
. The scroll to bottom is working fine, but we can't scroll up the page once the page scrolled to some location using $anchorScroll
and $location.hash()
.
See the issue clearly in codepen. Click on To Bottom button and try to scroll up back.
Please provide a solution to fix this scroll issue.
On "ion-content" div add overflow-scroll="true"
<ion-content overflow-scroll="true">
then in your controller:
$scope.scrollTo = function(id) {
$location.hash(id);
$ionicScrollDelegate.anchorScroll();
};
Further information for this issue in Ionic Framework can be found here: http://forum.ionicframework.com/t/content-stuck-after-anchorscroll/776