Text 1
Text 2
My application is performing poorly with jQuery\'s slideDown and slideUp. I\'m looking to use a CSS3 equivalent in browsers which support it.
Is it possible, using C
Variant without JavaScript. Only CSS.
CSS:
.toggle_block {
border: 1px solid #ccc;
text-align: left;
background: #fff;
overflow: hidden;
}
.toggle_block .toggle_flag {
display: block;
width: 1px;
height: 1px;
position: absolute;
z-index: 0;
left: -1000px;
}
.toggle_block .toggle_key {
font-size: 16px;
padding: 10px;
cursor: pointer;
-webkit-transition: all 300ms ease;
-moz-transition: all 300ms ease;
-ms-transition: all 300ms ease;
-o-transition: all 300ms ease;
transition: all 300ms ease;
}
.toggle_block .content {
padding: 0 10px;
overflow: hidden;
max-height: 0;
-webkit-transition: all 300ms ease;
-moz-transition: all 300ms ease;
-ms-transition: all 300ms ease;
-o-transition: all 300ms ease;
transition: all 300ms ease;
}
.toggle_block .content .toggle_close {
cursor: pointer;
font-size: 12px;
}
.toggle_block .toggle_flag:checked ~ .toggle_key {
background: #dfd;
}
.toggle_block .toggle_flag:checked ~ .content {
max-height: 1000px;
padding: 10px 10px;
}
HTML:
Text 1
Text 2
For next block only change ID and FOR attributes in html.