-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
54 lines (48 loc) · 1.2 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>pseudo scroll by CSS transition</title>
<style>
body {
margin: 0;
}
.scroll-to-top {
left: 5px;
position: fixed;
top: 5px;
}
.area {
height: 2000px;
}
.content {
height: 500px;
}
.content.content-1 {
background-color: #ff9999;
}
.content.content-2 {
background-color: #99ff99;
}
.content.content-3 {
background-color: #9999ff;
}
.js-scroll-transition {
-webkit-transition: transform 0.8s ease 0s;
-moz-transition: transform 0.8s ease 0s;
transition: transform 0.8s ease 0s;
}
</style>
</head>
<body>
<a class="scroll-to-top js-scroll-to-top" href="javascript:void 0">scroll to top</a>
<div class="area">
<div class="content content-1"></div>
<div class="content content-2"></div>
<div class="content content-3"></div>
</div>
<script src="index.js"></script>
</body>
</html>