账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    修改 swiper-wrapper 的偏移值不生效问题
    40
    0

    通过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);
    1
    打赏
    收藏
    点击回答
    您的回答被采纳后将获得:提问者悬赏的 11 元积分
        全部回答
    • 0
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部