ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
51.03k stars 13.51k forks source link

Expose scrollTo on scope or delegate #463

Closed mlynch closed 10 years ago

andrewgribben commented 10 years ago

I'd love to see this too. I can jump to locations with the following gotoHash() but if I scroll the page at all the position is off and obviously gotoTop() doesn't work.

$scope.gotoHash = function(thehash) {

    var old = $location.hash();
    $location.hash(thehash);
    $anchorScroll();
    $location.hash(old);

};

 $scope.gotoTop = function() {

    $location.hash('card-chapter-wrapper');
    $anchorScroll();

};
ajoslin commented 10 years ago

Added in c119498d1bdfe9c5ec0d7453fce8f9a18227977c

$ionicScrollDelegate.scrollTo(0, 200, true);
ionitron-bot[bot] commented 6 years ago

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.