当我打开父Div时,我想放大需要在再次单击时还原

当我开小班的div时,他会上新班-大。我想单击“ X”图像并删除大类以使该div再次变小。但是当我单击“ X”时,什么也不会发生,因为“ X”也是小类,我想...

有任何想法吗?

const small = document.getElementsByClassName('small');
const information = document.getElementsByClassName('information');
const big = document.getElementsByClassName('big');
const zamknij = document.getElementsByClassName('zamknij');

for (let i = 0; i < small.length; i++) {
    small[i].addEventListener('click', function () {
        small[i].classList.add("big");
        information[i].classList.add("widoczne");
        zamknij[i].style.display = "inherit ";
    });



}
* {
    padding: 0;
    margin: 0;
}

html {
    width: 100%;
    height: 100%;
}

body {
    font-family: Arial, Helvetica, Sans-serif;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 400;
    color: #F9F9F9;
    position: relative;
    min-height: 100vh;
    background-color: #7f8c8d;
}







#container {
    display: flex;
    flex-wrap: wrap;
    padding-left: 30px;
    padding-right: 30px;
}

.zamknij {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 20px;
    height: auto;
    display: none;
    opacity: 0.5;
    transition: 0.4s;

}

.zamknij:hover {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 20px;
    height: auto;
    display: none;
    cursor: pointer;
    opacity: 1;
    transition: 0.4s;
    transform: scale(1.2);
}

.small {
    max-width: 100px;
    min-width: 100px;
    max-height: 100px;
    min-height: 100px;
    background: linear-gradient(to bottom left, #3498db 50%, #2980b9 50%);
    margin: 20px;
    border-radius: 10px;
    transition: 0.3s;
    position: relative;
}

.small:hover {
    max-width: 100px;
    max-height: 100px;
    background: linear-gradient(to bottom left, #3498db 50%, #2980b9 50%);
    margin: 20px;
    border-radius: 10px;
    transform: scale(1.07);
    box-shadow: 4px 4px 13px 1px rgba(0, 0, 0, 0.65);

}

.medium {
    width: 300px;
    height: 100px;
    background: linear-gradient(to bottom left, #2ecc71 50%, #27ae60 50%);
    margin: 20px;
    border-radius: 10px;
    transition: 0.3s;
}

.medium:hover {
    width: 300px;
    height: 100px;
    background: linear-gradient(to bottom left, #2ecc71 50%, #27ae60 50%);
    margin: 20px;
    border-radius: 10px;
    transform: scale(1.07);
    box-shadow: 4px 4px 13px 1px rgba(0, 0, 0, 0.65);
}

.big {
    max-width: 1000px;
    max-height: 1000px;
    background: linear-gradient(to bottom left, #1abc9c 50%, #16a085 50%);
    margin: 20px;
    border-radius: 10px;
    transition: 0.3s;
    position: relative;
}

.big:hover {
    max-width: 1000px;
    max-height: 1000px;
    background: linear-gradient(to bottom left, #1abc9c 50%, #16a085 50%);
    margin: 20px;
    border-radius: 10px;
    transform: scale(1.07);
    box-shadow: 4px 4px 13px 1px rgba(0, 0, 0, 0.65);
    transition: 0.3s;

}

h2 {
    text-align: center;
    margin: 0 auto;
    font-size: 13px;
}

#lvl {
    position: relative;
    left: 20px;
    margin-top: 10px;
    margin-bottom: 8px;
    width: 60px;
}

h3 {
    margin: 10px;
    font-size: 12px;
    visibility: hidden;
}

.widoczne {
    visibility: visible;
}

.niewidoczne {
    visibility: hidden;
}
<div id="container">

        <div class=small>
            <div><img src="/ICONS/close.png" class="zamknij"></div>
            <img id="lvl" src="/ICONS/level-up.png">
            <h2>ROZBUDOWA</h2>
            <h3 class="information niewiodczne">
                Lorem ipsum dolor, sit amet consectetur adipisicing elit. Debitis aut neque animi unde nostrum
                voluptatibus ipsa quos. Adipisci odit laborum quis sapiente tempore ullam placeat dolorum et accusamus
                voluptates? Exercitationem.
            </h3>
        </div>

        <div class=small>
            <div><img src="/ICONS/close.png" class="zamknij"></div>
            <h2>CENY</h2>
            <h3 class="information niewiodczne">Lorem ipsum dolor sit amet consectetur adipisicing elit. Fugit repellat
                ratione maxime corrupti atque
                quos amet, tempora quisquam deleniti optio corporis exercitationem neque.</h3>
        </div>
        
         <div class=small>PROGRAMY NAPRAWCZE</div>
        <div class=small>Polecane dyski</div>
        <div class=small>ZAproponuj klientowi</div>
        <div class=small>częste usterki</div>
        <div class=small>Zwróć uwagę!</div>
        
        </div>