-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscroll.html
65 lines (65 loc) · 1.83 KB
/
scroll.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
59
60
61
62
63
64
65
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ScrollFrame</title>
<script src="./logFrame.js"></script>
<style>
* {
margin: 0;
padding: 0;
}
body {
height: 800px;
}
h1 {
background-color: sandybrown;
text-align: center;
}
.container {
position: relative;
top: 70px;
overflow: scroll;
box-sizing: border-box;
background-color: gray;
width: 260px;
height: 300px;
border: blue 11px solid;
}
.box {
background-color: red;
box-sizing: border-box;
width: 200px;
height: 540px;
border-top: blue 15px solid;
border-bottom: green 16px solid;
border-left: rebeccapurple 18px solid;
border-right: gold 19px solid;
padding-top: 11px;
padding-bottom: 23px;
margin-top: 25px;
margin-left: 27px;
margin-bottom: 29px;
}
</style>
</head>
<body>
<h1>欢迎来到前端小课</h1>
<div class="container">
<div class="box">《前端小课》由素燕创建,你现在学习的是第五阶段。关注公众号
素燕,前端从 0 到 1.
</div>
<!-- 'scrollTop' =,
'scrollLeft',
'scrollWidth = width - borderLeft - borderRight = 200 - 18 - 19 = 163',
'scrollHeight = height - borderTop - borderBottom = 540 - 15 -16 = 509', -->
</div>
<script>
logBySelector('.box');
logBySelector('.container');
window.onscroll = function () {
}
</script>
</body>
</html>