'(Javascript) How To Expand only one card inside slider


card.forEach((card,cardI) => {
    card.addEventListener('click',() => {
        activeCard()
        container.scrollLeft = scrollcard * cardI;
        card.classList.add('card-click');
        revealIsi()
    })
});


function activeCard(){
    card.forEach(card =>{
        card.classList.remove('card-click');
    })
}

function revealIsi(){
    expand.forEach(isi => {
        isi.classList.add('content-isi-reveal');
    });
}

https://codepen.io/shaderedeye/pen/OJOZPBO

recently make carousel card with vanilla js and looks like when card clicked,all card content got collapse,anyone know how to fix it?

i am really newbie for something like this



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source