Smooth scrolling service from http://jsfiddle.net/brettdewoody/y65G5/
Methods
-
Scroll.scrollTo(target, focus, percentage)
-
Scroll to a field.
Parameters:
Name Type Description target
The element to scroll to. Can be an item ID, an Angular element, or a number (yPos). focus
boolean If `true`, focus will be transfered to the target's first `input` element. percentage
number The offset (in percent) from the top of the screen. Returns:
Returns a promise that resolves once the animation on an element completes.- Type
- Promise
Examples
Scroll.scrollTo("firstName");
Scroll.scrollTo("firstName", true);
Scroll.scrollTo("firstName", false, 25);
// Regular syntax Scroll.scrollTo("firstName", false, 50); // A value of "true" for the third argument is interpreted as "50" Scroll.scrollTo("firstName", false, true);
Scroll.scrollTo(100);