-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
52 lines (43 loc) · 1.45 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta content="telephone=no,email=no" name="format-detection">
<title>animation scroll</title>
</head>
<body>
<div id="floor0" style="height: 200px;width:100%;background-color:salmon;">
<h3 style="color:#666;">楼层0</h3>
</div>
<button id="btn">滚动到第六层</button>
<div id="floor1" style="height: 200px;width:100%;background-color:aqua;">
<h3 style="color:#666;">楼层一</h3>
</div>
<div id="floor2" style="height: 400px;width:100%;background-color:blue;">
<h3>楼层二</h3>
</div>
<div id="floor3" style="height: 500px;width:100%;background-color:green;">
<h3>楼层三</h3>
</div>
<div id="floor4" style="height: 800px;width:100%;background-color:red;">
<h3>楼层四</h3>
</div>
<div id="floor5" style="height: 700px;width:100%;background-color:gray;">
<h3>楼层五</h3>
</div>
<div id="floor6" style="height: 900px;width:100%;background-color:springgreen;">
<h3>楼层六</h3>
</div>
<script src="./animation-scroll.js"></script>
<script type="text/javascript">
window.onload = function () {
document.getElementById('btn').addEventListener('click', function () {
animationScroll(document.getElementById('floor6'), 400, function (el) {
console.log(el);
});
}, false);
}
</script>
</body>
</html>