-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
39 lines (32 loc) · 1020 Bytes
/
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>loading-圆点</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="wrapper">
<div class="main" id="main_i"></div>
</div>
<script>
// 循环添加60个i标签
var main_i = document.getElementById("main_i");
main_i.innerHTML = function () {
var arr = [];
for (let i = 0; i < 60; i++) {
arr.push("<i class='iClass'></i>\n");
}
return arr.join('');
}();
var is = document.getElementsByClassName("iClass");
// var is = document.getElementsByTagName("i");
for (let i = 0; i < is.length; i++) {
is[i].style.transform = `rotate(${i * 12}deg) translateX(80px)`;
// 延迟的时间
is[i].style.animationDelay = `${i * 0.05}s`;
}
</script>
</body>
</html>