-
-
Notifications
You must be signed in to change notification settings - Fork 235
/
Copy pathmodule.js
42 lines (39 loc) · 1.46 KB
/
module.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
* x is a value between 0 and 1, indicating where in the animation you are.
*/
var duScrollDefaultEasing = function (x) {
'use strict';
if(x < 0.5) {
return Math.pow(x*2, 2)/2;
}
return 1-Math.pow((1-x)*2, 2)/2;
};
var duScroll = angular.module('duScroll', [
'duScroll.scrollspy',
'duScroll.smoothScroll',
'duScroll.scrollContainer',
'duScroll.spyContext',
'duScroll.scrollHelpers'
])
//Default animation duration for smoothScroll directive
.value('duScrollDuration', 350)
//Scrollspy debounce interval, set to 0 to disable
.value('duScrollSpyWait', 100)
//Scrollspy forced refresh interval, use if your content changes or reflows without scrolling.
//0 to disable
.value('duScrollSpyRefreshInterval', 0)
//Wether or not multiple scrollspies can be active at once
.value('duScrollGreedy', false)
//Default offset for smoothScroll directive
.value('duScrollOffset', 0)
//Default easing function for scroll animation
.value('duScrollEasing', duScrollDefaultEasing)
//Which events on the container (such as body) should cancel scroll animations
.value('duScrollCancelOnEvents', 'scroll mousedown wheel DOMMouseScroll mousewheel touchmove keydown')
//Whether or not to activate the last scrollspy, when page/container bottom is reached
.value('duScrollBottomSpy', false)
//Active class name
.value('duScrollActiveClass', 'active');
if (typeof module !== 'undefined' && module && module.exports) {
module.exports = duScroll;
}