Scroll to top


#1

How to smoothlly scroll to top (anchor)?

$location.hash('anch');
$anchorScroll();

That’s not working.


#2

Ionic already has a built-in scroll functionality.

Here’s a sample on how to use it : http://codepen.io/calendee/pen/jIJcm


#3

Thanks it works.
Can I make nice animation??


#4

Yep. See demo. Just changed to :

$scope.$broadcast('scroll.anchorScroll', true);


#5

You’re great! thanks


#6

Unfortunately scroll functionality doesn’t work.
Could you fix it somehow?


#7

I’ve noticed this too, and have had a hell of a time trying to implement scrolling. Commenting to see if anybody follows up.


#8

I’m also curious of a solution that would help me to scroll contents of a div with overflow-y: scroll to top/bottom.

And for the the ionic scroller (ion-contnent, etc) these two calls make the job of scrolling:

  $scope.scrollBottom = function() {
    $ionicScrollDelegate.scrollBottom(true);
  };

  $scope.scrollTop = function() {
    $ionicScrollDelegate.scrollTop(true);
  };

Remember about injecting the $ionicScrollDelegate

If any has a solution for scrolling div to top/bottom without jquery, please post an idea :smile: .


#9

I have a filter in a view that filters a ng-repeat. If the list is not on top filtered list is above panel. How do I know if the user start filtering the list.


#10

here is a tutorial for a scroll to top button
http://pointdeveloper.com/how-to-add-scroll-to-top-button-for-ionic-phonegap-app/