1

I have a number of areas on my web app where i have introduced $anchorScroll();

The actual functionality works has expected, in that, on click of a link, the user is moved to the corresponding section, however, the move is a 'jump' to the section, rather than a smooth scroll.

Here's a simple fiddle i created: http://jsfiddle.net/oampz/ZRLKC/

My js:

angular.module('test', []).controller('Ctrl', function ($scope, $location, $anchorScroll) {    

    $scope.scroll = function () {

         $location.hash('section-80');
         $anchorScroll();
    };

});

I am trying to achieve the effect found here (without using jquery or other libraries): http://www.surrealcms.com/blog/smoothly-scroll-to-an-element-without-a-jquery-plugin

Oam Psy
  • 8,555
  • 32
  • 93
  • 157
  • possible duplicate of [ScrollTo function in AngularJS](http://stackoverflow.com/questions/17284005/scrollto-function-in-angularjs) – Vucko Jun 24 '14 at 09:28
  • @Vucko - not a duplicate, ive asked how to achieve the above without jQuery, your example uses jQuery. – Oam Psy Jun 24 '14 at 09:40
  • 1
    Maybe https://stackoverflow.com/questions/21749878/angular-js-anchorscroll-smooth-duration is more what you're after? – ivarni Jun 24 '14 at 10:13
  • @ivarni - thanks, your link has helped get me started.. However i am trying to do what is quite simply achieved here: http://jsfiddle.net/oampz/ChDdE/490/ but via angular here: http://jsfiddle.net/oampz/ZRLKC/1/ – Oam Psy Jun 24 '14 at 11:04

0 Answers0