-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathtest.html
More file actions
74 lines (70 loc) · 2.28 KB
/
test.html
File metadata and controls
74 lines (70 loc) · 2.28 KB
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
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style media="screen">
* {
margin: 0;
padding: 0;
}
.demo {
height: 300px;
width: 300px;
background-color: blue;
color: #fff;
margin: 10px;
}
#app2 {
border: 3px solid red;
padding: 10px;
}
#app3 {
overflow-x: auto;
border: 3px solid red;
padding: 10px;
}
#app3 span{
display: block;
width: 500px;
}
</style>
</head>
<body>
<div id="app" class="demo">app元素区域</div>
<script type="text/javascript">
var app = document.getElementById("app");
var appJson = {};
appJson.clientWidth = app.clientWidth;
appJson.offsetWidth = app.offsetWidth;
appJson.scrollWidth = app.scrollWidth;
</script>
<div id="app2" class="demo">app2元素区域</div>
<script type="text/javascript">
var app2 = document.getElementById("app2");
var appJson2 = {};
appJson2.clientWidth = app2.clientWidth;
appJson2.offsetWidth = app2.offsetWidth;
appJson2.scrollWidth = app2.scrollWidth;
</script>
<div id="app3" class="demo">
<span>
app3元素区域app3元素区域app3元素区域app3元素区域app3元素区域app3元素区域app3元素区域app3元素区域app3元素区域app3元素区域
</span>
</div>
<script type="text/javascript">
var app3 = document.getElementById("app3");
var appJson3 = {};
appJson3.clientWidth = app3.clientWidth;
appJson3.offsetWidth = app3.offsetWidth;
appJson3.scrollWidth = app3.scrollWidth;
</script>
<script type="text/javascript">
var jsonData = {};
jsonData.app = appJson;
jsonData.app2 = appJson2;
jsonData.app3 = appJson3;
console.table(jsonData);
</script>
</body>
</html>