(Sorry for my English, it’s not my native language)
I created a function that widens a wrapper containing a visible small element and display an invisible element (map). If I click on another wrapper, the function works as well, but I would like to cancel the effect on the first wrapper.
Can you help me?
wrapper.forEach((wrapperElement)=> {
let mapElement = wrapperElement.querySelector(".map");
wrapperElement.addEventListener('click', function reset(){
mapElement.classList.toggle('show');
wrapperElement.classList.toggle('focus');
});
});
I think I should attribute isWiden = true to the first wrapper, and the function would test it before targeting the second wrapper. But I’m struggling to do that.