You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ Using a CDN via jsDelivr:
18
18
19
19
********************************************
20
20
21
-
##Method - trigger(options, callback)
21
+
##Method - trigger(options, callback)
22
22
23
23
**Description:**
24
24
A method for adding triggers when element is visible in the viewport.
@@ -36,6 +36,8 @@ as long as the scroll event is happening.
36
36
37
37
**alwaysRunOnTrigger (boolean)**: by default the triggered element callback will only be executed one time. Setting to true will re-trigger the callback everytime the element has been in and out of the viewport.
38
38
39
+
**treshold (number)**: add this much pixels to calculation to the visibility check (useful if you want to execute code just before the element becomes visible)
40
+
39
41
**callback (object)**:
40
42
This is the function which will be exectued when the element is detected in the viewport. To reference the node, pass it
41
43
into the callback as an argument.
@@ -46,14 +48,15 @@ into the callback as an argument.
46
48
target: '.collection-list .items',
47
49
surfaceVisible: 0.5,
48
50
runOnScroll: true,
49
-
alwaysRunOnTrigger: true
51
+
alwaysRunOnTrigger: true,
52
+
treshold: 200
50
53
}, (element) => {
51
54
$(element).addClass("visible");
52
55
});
53
56
54
57
********************************************
55
58
56
-
##Method - sequence(options, callback)
59
+
##Method - sequence(options, callback)
57
60
58
61
**Description:**
59
62
A method for staggering an array of triggers.
@@ -98,7 +101,7 @@ can get the item and index of the array as arguments
98
101
99
102
********************************************
100
103
101
-
##Method - out(function)
104
+
##Method - out(function)
102
105
103
106
When the trigger is has been executed and the element is no longer in the viewport, the out method
104
107
can be chained to the trigger to execute the specified function.
@@ -116,7 +119,7 @@ can be chained to the trigger to execute the specified function.
0 commit comments