-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.html
53 lines (52 loc) · 1.35 KB
/
test.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test</title>
<style>
section {
padding: 500px 0;
}
#one {
background-color: red;
}
#two {
background-color: yellow;
}
#three {
background-color: blue;
}
#four {
background-color: green;
}
header > a {
display: inline-block;
}
</style>
</head>
<body>
<header>
<a href="#one">One</a>
<a href="#two">Two</a>
<a href="#three">Three</a>
<a href="#four">Four</a>
</header>
<main>
<section id="one" swinch-duration="1000"></section>
<section id="two"></section>
<section id="three" swinch-offset="200"></section>
<section id="four" swinch-duration="5000" swinch-offset="300"></section>
</main>
<script src="./dist/swinch.js"></script>
<script type="text/javascript">
swinch.init(null, {
onBeforeSnap: function (current, next, direction) {
console.log('onBeforeSnap', current, next, direction);
},
onSnapped: function (current, previous, direction) {
console.log('onSnapped', current, previous, direction);
}
});
</script>
</body>
</html>