-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.js
47 lines (34 loc) · 993 Bytes
/
main.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
43
44
45
46
47
$(document).ready(function() {
$("#fullpage").fullpage({
anchors: ["firstPage", "secondPage", "thirdPage"],
menu: "#menu",
autoScrolling:false
// responsiveWidth: 750
});
});
// ScrollMagic: init controller
var controller = new ScrollMagic.Controller();
// Tween - Section 2
var scene = new ScrollMagic.Scene({
triggerElement: "#section2"
})
// animate color and top border in relation to scroll position
.setTween("#bg img", {
maxWidth: "1200px",
top: "30%",
left: "80%",
opacity: 0.25
}) // the tween durtion can be omitted and defaults to 1
// .addIndicators({ name: "2 (duration: 100)" }) // add indicators (requires plugin)
.addTo(controller);
// Tween - Section 3
var scene = new ScrollMagic.Scene({
triggerElement: "#section3",
duration: 300
})
// animate color and top border in relation to scroll position
.setTween("#bg img", {
top: "20%"
}) // the tween duration can be omitted and defaults to 1
// Add indicators (required plugin)
.addTo(controller);