index.js
5.4 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
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
//->REM
~function () {
var desW = 750,
winW = document.documentElement.clientWidth,
ratio = winW / desW,
oMain = document.querySelector('.main');
if (winW > desW) {
oMain.style.margin = '0 auto';
oMain.style.width = desW + 'px';
return;
}
document.documentElement.style.fontSize = ratio * 100+ 'px';
//加减号
function Show_Hidden1(obj,obj2,obj3,obj4) {
if(obj.style.display=="block")
{
obj.style.display='none';
obj2.style.borderBottom='1px solid #ccc';
obj3.style.webkitAnimation="rotateIn 1s 0s both";
obj3.style.animation="rotateIn 1s 0s both";
obj3.innerHTML="+";
obj3.style.fontSize="24px";
obj3.style.width=".17rem"
obj3.style.marginRight=".68rem";
obj4.style.borderTop='none';
}
else
{
obj.style.display='block';
obj4.style.borderTop='1px solid #ccc';
obj2.style.borderBottom='none';
obj3.style.webkitAnimation="rotateIn 1s 0s both";
obj3.style.animation="rotateIn 1s 0s both";
obj3.innerHTML="-";
obj3.style.fontSize="24px";
obj3.style.width=".17rem"
obj3.style.marginRight=".55rem";
}
}
function Show_Hidden2(obj,obj2,obj3,obj4) {
if(obj.style.display=="block")
{
obj.style.display='none';
obj2.style.borderBottom='1px solid #ccc';
obj3.style.webkitAnimation="rotateIn 1s 0s both";
obj3.style.animation="rotateIn 1s 0s both";
obj3.innerHTML="+";
obj3.style.fontSize="24px";
obj3.style.width=".17rem"
obj3.style.marginRight=".68rem";
obj4.style.borderTop='none';
}
else
{
obj.style.display='block';
obj2.style.borderBottom='none';
obj3.style.webkitAnimation="rotateIn 1s 0s both";
obj3.style.animation="rotateIn 1s 0s both";
obj3.innerHTML="-";
obj3.style.fontSize="24px";
obj3.style.width=".17rem"
obj3.style.marginRight=".55rem";
obj4.style.borderTop='1px solid #ccc';
}
}
function Show_Hidden3(obj,obj2,obj3,obj4) {
if(obj.style.display=="block")
{
obj.style.display='none';
obj2.style.borderBottom='1px solid #ccc';
obj3.style.webkitAnimation="rotateIn 1s 0s both";
obj3.style.animation="rotateIn 1s 0s both";
obj3.innerHTML="+";
obj3.style.fontSize="24px";
obj3.style.marginRight=".68rem";
obj4.style.borderTop='none';
}
else
{
obj.style.display='block';
obj2.style.borderBottom='none';
obj3.style.webkitAnimation="rotateIn 1s 0s both";
obj3.style.animation="rotateIn 1s 0s both";
obj3.innerHTML="-";
obj3.style.width=".17rem"
obj3.style.fontSize="24px";
obj3.style.marginRight=".55rem";
obj4.style.borderTop='1px solid #ccc';
}
}
function Show_Hidden4(obj,obj2,obj3,obj4) {
if(obj.style.display=="block")
{
obj.style.display='none';
//加号动画
obj3.style.webkitAnimation="rotateIn 1s 0s both";
obj3.style.animation="rotateIn 1s 0s both";
obj3.innerHTML="+";
obj3.style.fontSize="24px";
obj3.style.marginRight=".68rem";
obj2.style.borderBottom='1px solid #ccc';
}
else
{
obj.style.display='block';
obj.style.marginBottom='0';
obj2.style.borderBottom='none';
obj3.style.webkitAnimation="rotateIn 1s 0s both";
obj3.style.animation="rotateIn 1s 0s both";
obj3.innerHTML="-";
obj3.style.width=".17rem";
obj3.style.fontSize="24px";
obj3.style.marginRight=".55rem";
// obj2.style.borderBottom='none';
}
}
//每一个整体
var character1=document.getElementById("character-1");
var character2=document.getElementById("character-2");
var character3=document.getElementById("character-3");
var character4=document.getElementById("character-4");
//加号
var characterA =document.getElementById("character-1-a");
var characterA2 =document.getElementById("character-2-a");
var characterA3 =document.getElementById("character-3-a");
var characterA4 =document.getElementById("character-4-a");
//展开部分
var characterUnfold=document.getElementById("character-1-unfold");
var characterUnfold2=document.getElementById("character-2-unfold");
var characterUnfold3=document.getElementById("character-3-unfold");
var characterUnfold4=document.getElementById("character-4-unfold");
character1.onclick=function onclick1() {
Show_Hidden1(characterUnfold,character1,characterA,character2);
}
character2.onclick=function onclick2() {
Show_Hidden2(characterUnfold2,character2,characterA2,character3);
}
character3.onclick=function onclick3() {
Show_Hidden3(characterUnfold3,character3,characterA3,character4);
}
character4.onclick=function onclick4() {
Show_Hidden4(characterUnfold4,character4,characterA4);
}
}();