Skip to content

arnaudmolo/angular-smooth-scroll

Repository files navigation

Bitdeli Badge

angular-smooth-scroll

A smoothscroll service promise based for AngularJS

Based on Arnaud Breton's algorithme and promises

How To

include the SmoothScroll in your application dependencies

SmoothScroll.$goTo(param) return a promises resolved when the scroll is done

var promise = SmoothScroll.$goTo(600); promise.then(function(end){ console.log("done", end); });

  SmoothScroll.$goTo(0).then(function() {
    return SmoothScroll.$goTo(500);
  }).then(function() {
    return SmoothScroll.$goTo(200);
  }).then(function() {
    return SmoothScroll.$goTo(800);
  }).then(function() {
    return SmoothScroll.$goTo(0);
  }).then(function() {
    return SmoothScroll.$goTo(200);
  });

$goTo accepts :

  • number
  • simple DOM element
  • angular element
  • selector

Next step:

  • tests!
  • accept elements as arguments
  • accept Y scrolls

About

A smoothscroll service promise based for AngularJS

Resources

Stars

Watchers

Forks

Packages

No packages published