【发布时间】:2022-12-03 15:32:30
【问题描述】:
I search that resize event detect when i resizing the windows, and i know the widht o window can i get it using window.innerWidth or innerWidht
const swiperRooms = document.querySelector(\'#swiperRooms\'); //this contain class mySwiper-rooms
addEventListener(\"resize\", (event) => {
if(innerWidth < 834) swiperRooms?.classList.toggle(\'mySwiper\');
});
I want to change the class of my swiper(slider) to other class that i have but i dont know why my code doesnt work. Its my first time doing resize
标签: javascript html typescript class swiper.js