-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
49 lines (49 loc) · 1.1 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
<meta name="Keywords" content="" />
<meta name="description" content="" />
<meta name="author" content="Administrator" />
<style>
.wrap span{ display:block; float:left; width:80px; border:1px solid #ddd; line-height:32px; padding:0 4px; text-align:center; margin: -1px 0 0 -1px;}
.wrap .clear{ clear:both;}
</style>
</head>
<body>
<div id="wrap" class="wrap"></div>
</body>
<script>
var obj=document.getElementById('wrap'),
i=0,j=1;
var timer=setInterval(function(){
if((i+1) <= j){
i++;
}
else{
var node=document.createElement('div');
node.className='clear';
obj.appendChild(node);
j++;
i=1;
}
if(j > 9){
clearInterval(timer);
var reverse=setInterval(function(){
if(obj.children.length){
obj.removeChild(obj.children[obj.children.length - 1]);
}
else{
clearInterval(reverse);
}
},100);
}
else{
var node=document.createElement('span');
node.innerHTML=i + '*' + j + '=' + i*j;
obj.appendChild(node);
}
},100);
</script>
</html>