forked from WangJia-mm/JavaScript201708
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path4-Multiplication.html
More file actions
65 lines (57 loc) · 1.35 KB
/
4-Multiplication.html
File metadata and controls
65 lines (57 loc) · 1.35 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>99乘法表</title>
<link rel="stylesheet" href="css/reset.min.css"/>
<style>
html, body {
width: 100%;
height: 100%;
background: url("img/9999.jpg") no-repeat;
background-size: cover;
}
#box {
padding: 10px;
}
#box li {
margin-top: 10px;
height: 35px;
}
#box li span {
float: left;
margin-right: 10px;
width: 100px;
line-height: 35px;
text-align: center;
background: rgba(0, 0, 0, 0.1);
opacity: 0;
}
</style>
</head>
<body>
<ul id="box">
</ul>
<script src="js/jquery-1.11.3.min.js"></script>
<script>
//->创建99乘法表
var $box = $('#box');
var str = '';
for (var i = 1; i <= 9; i++) {
str += '<li>';
for (var j = 1; j <= i; j++) {
str += '<span>' + j + ' * ' + i + ' = ' + (i * j) + '</span>';
}
str += '</li>';
}
$box.html(str);
//->出现时候的动画
var $list = $box.find('span');
$list.each(function (index, item) {
window.setTimeout(function () {
$(item).stop().animate({opacity: 1}, 500);
}, index * 30);
});
</script>
</body>
</html>