-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
94 lines (93 loc) · 2.54 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
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
<!DOCTYPE html>
<html lang="en-EN">
<head>
<meta charset="UTF-8">
<title>Accordion Example</title>
</head>
<body>
<style>
button.accordion {
background-color: #eee;
color: #444;
cursor: pointer;
padding: 18px;
width: 100%;
border: none;
text-align: left;
outline: none;
font-size: 15px;
transition: 0.4s
}
button.accordion.active,
button.accordion:hover {
background-color: #ddd
}
button.accordion:after {
/* Unicode character for "plus" sign
(+) is '\02795' */
content: '\02795';
font-size: 13px;
color: #777;
float: right;
margin-left: 5px
}
button.accordion.active:after {
/* Unicode character for "minus" sign
(-) is '\2796' */
content: "\2796"
}
div.panel {
padding: 0 18px;
background-color: white;
max-height: 0;
overflow: hidden;
transition: 0.6s ease-in-out;
opacity: 0
}
div.panel.show {
opacity: 1;
max-height: 500px
}
</style>
<h2>Accordion Example</h2>
<button class="accordion">Tiger
</button>
<div class="panel">
<p>The tiger is the largest cat
species, most recognisable for their
pattern of dark vertical stripes on
reddish-orange fur with a lighter
underside.</p>
</div>
<button class="accordion">Lion</button>
<div class="panel">
<p>The lion is one of the big cats
in the genus Panthera and a member of
the family Felidae.The commonly used
term African lion collectively denotes
the several subspecies in Africa.</p>
</div>
<button class="accordion">Cheetah
</button>
<div class="panel">
<p>The cheetah, also known as the
hunting leopard, is a big cat that
occurs mainly in easternand southern
Africa and a few parts of Iran</p>
</div>
<script>
var acc = document
.getElementsByClassName("accordion");
var i;
for (i = 0; i < acc.length; i++) {
acc[i].onclick = function(){
this.classList.toggle("active");
this.nextElementSibling.classList
.toggle("show");
}
}
</script>
</body>
</html>
</body>
</html>