-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
125 lines (120 loc) · 2.99 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>js 常用方法库</title>
<style>
#box {
/* position: absolute; */
width: 0px;
height: 0px;
content: ' ';
display: block;
border-right: 100px solid red;
border-top: 100px solid #ff0;
border-left: 100px solid blue;
border-bottom: 100px solid green;
}
#select {
user-select: none; /* 禁止用户选择文本 */
}
.taiji {
margin: 10px;
width: 200px;
height: 200px;
border-radius: 50%;
border: 1px solid #000;
overflow: hidden; /* 创建 BFC 并且隐藏左右两边非圆区域 */
position: relative;
animation: customRotate 5s linear infinite;
}
.left {
float: left;
width: 100px;
height: 100%;
background: #000;
}
.rigth {
float: right;
width: 100px;
height: 100%;
background: #fff;
}
.top {
width: 100px;
height: 100px;
border-radius: 50%;
background: #000;
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
}
.bottom {
width: 100px;
height: 100px;
border-radius: 50%;
background: #000;
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
background: #fff;
}
.children {
width: 20px;
height: 20px;
border-radius: 50%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: #000;
}
.top .children {
background: #fff;
}
@keyframes customRotate {
from {
transform: rotate(0deg)
}
to {
transform: rotate(360deg)
}
/* 100% {
transform: rotate(360deg)
} */
}
</style>
</head>
<body>
<div id="select">的房价按客服静安寺房间爱上咖啡就</div>发送到发事发地点啊发生的
<div id="box" draggable="true"></div>
<input id="search" type="text"> 搜索
<div class="taiji">
<div class="left"></div>
<div class="right"></div>
<div class="top">
<div class="children"></div>
</div>
<div class="bottom">
<div class="children"></div>
</div>
</div>
<script type="module" src="./test.js"></script>
<script>
function foo() {
console.log(a); // 输出 2,作用域是在函数定义的时候确定的,this是在函数调用的时候确定的
}
function bar() {
var a = 3;
foo();
}
var a = 2;
bar();
// js 只有词法作用域,没有动态作用域
</script>
</body>
</html>