Accessing Scroller

I believe Scoller is used within Ionic to provide a scrollable div (please correct me if Im wrong!).

How do I gain access to the Scroller functionality, specifically getValues() and scrollTo()?

Thanks,
Greg

Hey in theory any child scope of the content directive should have access to the scrollView, but it looks like there’s a timing bug.

Just brought it up to @max, so this issue should hopefully be fixed soon.

This has been fixed: https://github.com/driftyco/ionic/issues/458#issuecomment-33097781.

The one caveat is to wait until the linking function for <content> has been called.

  $scope.scrollDown = function(){
    var sv = $ionicScrollDelegate.getScrollView($scope);
    var top = sv.getScrollMax().top;
    sv.scrollTo(null, top, true, null);
  }
1 Like