const list = document.querySelectorAll('.list .test')
window.addEventListener('click', (e)=> {
const target = e.target;
if(target.classList.contains('test')){
resetActiveItem()
target.classList.add('active')
}
if(target.classList.contains('reset')) {
resetActiveItem()
}
})
function resetActiveItem() {
list.forEach(item=>item.classList.remove('active'));
}
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
media screen and (max-width: 1200px) {
.container {
width: 970px;
}
}
media screen and (max-width: 991px) {
.container {
width: 750px;
}
}
media screen and (max-width: 767px) {
.container {
width: 450px;
}
}
media screen and (max-width: 479px) {
.container {
width: 310px;
}
}
$(document).ready(function() {
$('#fullpage').fullpage({
scrollBar:true,
afterSlideLoad: function(anchorLink, index, slideAnchor, slideIndex){
if ( slideIndex != 0 ) {
wow = new WOW(
{
animateClass: 'animated',
live: true
}
);
wow.init();
}
},
onSlideLeave: function(anchorLink, index, slideIndex, direction){
$('.slide').not('.slide-' + slideIndex).find('.wow').css('visibility', 'hidden');
},
});
});