-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript2.js
93 lines (92 loc) · 3.14 KB
/
script2.js
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
var color=document.getElementById('btn1');
var c1=0;
color.addEventListener('click',function(){
if(c1==0)
{
document.getElementById('outer').style.backgroundColor="green";
}
else if(c1==1)
{
document.getElementById('outer').style.backgroundColor="Yellow";
}
else if(c1==2)
{
document.getElementById('outer').style.backgroundColor="cyan";
}
else if(c1==3)
{
document.getElementById('outer').style.backgroundColor="black";
}
else if(c1==4)
{
document.getElementById('outer').style.backgroundColor="red";
}
else if(c1==5)
{
document.getElementById('outer').style.backgroundColor="orange";
}
else if(c1==6)
{
document.getElementById('outer').style.backgroundColor="pink";
}
else if(c1==7)
{
document.getElementById('outer').style.backgroundColor="brown";
}
else if(c1==8)
{
document.getElementById('outer').style.backgroundColor="purple";
}
else if(c1==9)
{
document.getElementById('outer').style.backgroundColor="skyblue";
}
else if(c1==10)
{
document.getElementById('outer').style.backgroundColor="blue";
c1=0;
}
c1+=1;
});
var c2=0;
var shape=document.getElementById('btn2');
shape.addEventListener('click',function(){
if(c2==0)
{
document.getElementById('inner').style.height="100px";
document.getElementById('inner').style.width="100px";
document.getElementById('inner').style.borderTopRightRadius="100%";
document.getElementById('inner').style.borderBottomRightRadius="0%";
document.getElementById('inner').style.borderBottomLeftRadius="0%";
document.getElementById('inner').style.borderTopLeftRadius="0%";
}
else if(c2==1)
{
document.getElementById('inner').style.height="100px";
document.getElementById('inner').style.width="100px";
document.getElementById('inner').style.borderTopRightRadius="0%";
document.getElementById('inner').style.borderBottomRightRadius="100%";
document.getElementById('inner').style.borderBottomLeftRadius="0%";
document.getElementById('inner').style.borderTopLeftRadius="0%";
}
else if(c2==2)
{
document.getElementById('inner').style.height="100px";
document.getElementById('inner').style.width="100px";
document.getElementById('inner').style.borderTopRightRadius="0%";
document.getElementById('inner').style.borderBottomRightRadius="0%";
document.getElementById('inner').style.borderBottomLeftRadius="100%";
document.getElementById('inner').style.borderTopLeftRadius="0%";
}
else if(c2==3)
{
document.getElementById('inner').style.height="100px";
document.getElementById('inner').style.width="100px";
document.getElementById('inner').style.borderTopRightRadius="0%";
document.getElementById('inner').style.borderBottomRightRadius="0%";
document.getElementById('inner').style.borderBottomLeftRadius="0%";
document.getElementById('inner').style.borderTopLeftRadius="100%";
c2=-1;
}
c2+=1;
});