-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
60 lines (55 loc) · 2.08 KB
/
demo.html
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>ScrollTrigger Demo</title>
</head>
<body style="min-height: 1000px;">
<div id="one" style="position: absolute; top: 100px; width: 100%;">
Trigger at 100px
<hr>
</div>
<div id="two" style="position: absolute; top: 300px; width: 100%;">
Trigger at 300px
<hr>
</div>
<div id="three" style="position: absolute; top: 500px; width: 100%;">
Trigger at 500px
<hr>
</div>
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="scrolltrigger.js"></script>
<script>
$(document).ready(function () {
new ScrollTrigger({
triggerPosition: 100, // this can be set with $(element).offset() too
triggerDownCallback: function () {
console.log('Going down at 100!');
},
triggerUpCallback: function () {
console.log('Going up at 100!');
}
});
new ScrollTrigger({
triggerPosition: 300, // this can be set with $(element).offset() too
triggerDownCallback: function () {
console.log('Going down at 300!');
},
triggerUpCallback: function () {
console.log('Going up at 300!');
}
});
new ScrollTrigger({
triggerPosition: 500, // this can be set with $(element).offset() too
triggerDownCallback: function () {
console.log('Going down at 500!');
},
triggerUpCallback: function () {
console.log('Going up at 500!');
}
});
})
</script>
</body>
</html>