通过js改了swiper-container和swiper-slide的宽度 可是swiper-wrapper的偏移值没有变,该怎么修改?有没有大神帮忙解答一下
var mw=screen.width;
function hengshuping(){
if(window.orientation==180||window.orientation==0){
}
if(window.orientation==90||window.orientation==-90){
var obj=document.getElementById("mw");
var obb=document.getElementsByClassName("swiper-wrapper");
var obc=document.getElementsByClassName("swiper-slide");
obj.style.width=mw+"px";
obj.style.height=mw+"px";
obc[0].style.width=mw+"px";
obc[0].style.height=mw+"px";
obc[1].style.width=mw+"px";
obc[1].style.height=mw+"px";
obc[2].style.width=mw+"px";
obc[2].style.height=mw+"px";
obc[3].style.width=mw+"px";
obc[3].style.height=mw+"px";
obc[4].style.width=mw+"px";
obc[4].style.height=mw+"px";
obc[5].style.width=mw+"px";
obc[5].style.height=mw+"px";
obc[6].style.width=mw+"px";
obc[6].style.height=mw+"px";
obc[7].style.width=mw+"px";
obc[7].style.height=mw+"px";
alert(1)
}
}
$(function(){
hengshuping();
});
window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", hengshuping, false);