forked from shiyiya/scrolled-into-view
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
58 lines (53 loc) · 1.47 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Document</title>
<style>
h1 {
transition: all 2s;
text-align: center;
color: mediumpurple;
animation: right2left 2s;
}
.in {
letter-spacing: 10px;
color: rgb(32, 173, 163);
}
</style>
</head>
<body>
<h1 id="0">scrolledIntoView 0</h1>
<h1 id="1">scrolledIntoView 1</h1>
<h1 id="2">scrolledIntoView 2</h1>
<h1 id="3">scrolledIntoView 3</h1>
<h1 id="4">scrolledIntoView 4</h1>
<h1 id="5">scrolledIntoView 5</h1>
<h1 id="6">scrolledIntoView 6</h1>
<h1 id="7">scrolledIntoView 7</h1>
<h1 id="8">scrolledIntoView 8</h1>
<h1 id="9">scrolledIntoView 9</h1>
<h1 id="10">scrolledIntoView 10</h1>
<h1 id="11">scrolledIntoView 11</h1>
<h1 id="12">scrolledIntoView 12</h1>
<h1 id="13">scrolledIntoView 13</h1>
<h1 id="14">scrolledIntoView 14</h1>
<h1 id="15">scrolledIntoView 15</h1>
<h1 id="16">scrolledIntoView 16</h1>
<script src="./dist/scrolledintoview.min.js"></script>
<script>
scrolledIntoView(
'h1',
function(el) {
el.classList.add('in')
},
function(el) {
el.classList.remove('in')
}
)
</script>
<!-- <script src="./example/index.js"></script> -->
</body>
</html>