# Expanding Cards
Explore The World
Wild Forest
Sunny Beach
City on Winter
Mountains - Clouds
let panel=document.querySelectorAll('.panel')
panel.forEach(item=>{
item.addEventListener('click',(e)=>{
//相邻元素移除active
[].filter.call(item.parentElement.children,el=>el!==item).forEach(el=>el.classList.remove('active'));
item.classList.add('active')
})
})
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
← 满天星特效 progress steps →