|
24 | 24 | extraIndicators: {} |
25 | 25 | }; |
26 | 26 |
|
27 | | - // Events |
28 | | - let scrollDirection = $.Event("scrollDirection"), |
29 | | - scrollDown = $.Event("scrollDown"), |
30 | | - scrollUp = $.Event("scrollUp"), |
31 | | - scrollAtTop = $.Event("scrollAtTop"), |
32 | | - scrollAtMiddle = $.Event("scrollAtMiddle"), |
33 | | - scrollAtBottom = $.Event("scrollAtBottom"); |
34 | | - |
35 | 27 | // Method: init() |
36 | 28 | obj.init = function (options) { |
37 | 29 | pluginActive = true; |
38 | 30 | // update settings |
39 | 31 | settings = $.extend(settings, options); |
40 | 32 | }; |
41 | 33 |
|
42 | | - // Method: destroy() |
43 | | - obj.destroy = function () { |
44 | | - pluginActive = false; |
45 | | - |
46 | | - // update states |
47 | | - obj.isScrollUp = false; |
48 | | - obj.isScrollDown = false; |
49 | | - obj.isScrollAtTop = false; |
50 | | - obj.isScrollAtMiddle = false; |
51 | | - obj.isScrollAtBottom = false; |
52 | | - |
53 | | - // remove all indicators |
54 | | - indicator(); |
55 | | - }; |
56 | | - |
57 | 34 | // APIs |
58 | 35 | obj.isScrollUp = false; |
59 | 36 | obj.isScrollDown = false; |
60 | 37 | obj.isScrollAtTop = false; |
61 | 38 | obj.isScrollAtMiddle = false; |
62 | 39 | obj.isScrollAtBottom = false; |
63 | 40 |
|
| 41 | + // Events |
| 42 | + let scrollDirection = $.Event("scrollDirection"), |
| 43 | + scrollDown = $.Event("scrollDown"), |
| 44 | + scrollUp = $.Event("scrollUp"), |
| 45 | + scrollAtTop = $.Event("scrollAtTop"), |
| 46 | + scrollAtMiddle = $.Event("scrollAtMiddle"), |
| 47 | + scrollAtBottom = $.Event("scrollAtBottom"); |
| 48 | + |
64 | 49 | // Indicator: add class to indicate the scrolling status |
65 | 50 | function indicator(options) { |
66 | 51 | if (settings.indicator) { |
|
174 | 159 | for (i; i < l; i++) { |
175 | 160 | indicator({ |
176 | 161 | "values": [scrollAmount >= settings.extraIndicators[i]["element"].offset().top], |
177 | | - "classes": [settings.extraIndicators[i]["indicator"]] |
| 162 | + "classes": [settings.extraIndicators[i]["class"]] |
178 | 163 | }); |
179 | 164 | } |
180 | 165 |
|
|
0 commit comments