File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed
Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ var body = document.querySelector('body > main > section#body');
55var footer = document . querySelector ( 'body > main > section#footer' ) ;
66var significantChange = document . querySelector ( 'body > main > section#significantChange' ) ;
77var result = document . querySelector ( 'body > main > section#result' ) ;
8+ let sections = Array . from ( document . querySelectorAll ( 'main > section' ) ) ;
89
910
1011var currentTarget = type ;
@@ -23,6 +24,8 @@ function waitTransition(section) {
2324
2425 try {
2526
27+ sections . forEach ( element => element . classList . add ( 'visible' ) ) ;
28+
2629 let loop = setInterval ( ( ) => {
2730
2831 if (
@@ -31,6 +34,9 @@ function waitTransition(section) {
3134 ) {
3235
3336 clearInterval ( loop ) ;
37+
38+ sections . forEach ( element => ( element . id != section . id ) && element . classList . remove ( 'visible' ) ) ;
39+
3440 resolve ( ) ;
3541
3642 }
Original file line number Diff line number Diff line change @@ -28,6 +28,11 @@ main {
2828
2929 display : flex;
3030 flex-flow : column;
31+
32+ visibility : hidden;
33+ }
34+ main > section .visible {
35+ visibility : visible;
3136 }
3237 main > section > details {
3338 flex : 0 ;
Original file line number Diff line number Diff line change 3333 <!-- <header></header> -->
3434
3535 < main >
36- < section id ="type ">
36+ < section id ="type " class =" visible " >
3737
3838 < details >
3939 < summary > Type</ summary >
You can’t perform that action at this time.
0 commit comments