File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 6
6
}
7
7
8
8
.collapsible-content {
9
- max-height : 40em ;
10
9
transition : max-height 0.3s ease-out;
11
10
}
12
11
13
12
.collapsible-content .collapsed {
14
13
overflow : hidden;
15
- max-height : 0 ;
14
+ max-height : 0 !important ;
16
15
}
Original file line number Diff line number Diff line change 1
1
document . addEventListener ( "DOMContentLoaded" , ( ) => {
2
+ // Set maxHeight to scroll height on all matching collapsibles
3
+ const contentContainers = document . getElementsByClassName ( "collapsible-content" ) ;
4
+ for ( const container of contentContainers ) {
5
+ container . style . maxHeight = container . scrollHeight + "px" ;
6
+ }
7
+
2
8
const headers = document . getElementsByClassName ( "collapsible" ) ;
3
9
for ( const header of headers ) {
4
10
header . addEventListener ( "click" , ( ) => {
You can’t perform that action at this time.
0 commit comments