This line was not in the code that was improved.:
document.querySelector(".container.with-curtain").classList.add("hide");
In that topic, this is the code that was worked on. See
The code you developed.
Code:
(function manageCovera(d) {
const allPlayButtons = d.querySelectorAll(".thePlay");
const allContainers = d.querySelectorAll(".container");
function show(el) {
el.classList.remove("hide");
}
function hide(el) {
el.classList.add("hide");
}
function addClickToButtons() {
for (let i = 0; i < allPlayButtons.length; i++) {
allPlayButtons[i].addEventListener("click", coverClickHandler);
}
}
function coverClickHandler(evt) {
const cover = evt.currentTarget.parentElement;
for (let i = 0; i < allContainers.length; i++) {
allContainers[i].classList.add("hide");
}
cover.classList.add("active");
cover.classList.remove("hide");
}
addClickToButtons();
})(document);