通常pc端的方法对移动端不适用,因而增长了几个样式就成功禁止滑动html
.noscroll, .noscroll body { overflow: hidden; position: relative; top: 0; height: 100%; }
有蒙层出现时$('html, body').addClass('noscroll');浏览器
蒙层消失时$('html, body').removeClass('noscroll');iphone
在用iphone xr等手机访问钉钉内置浏览器可能会有fixed的bug(移动尽可能少用fixed,由于他不随页面滑动而滑动,并且登陆注册等这种涉及到用户填写的表单别用弹窗不要用弹窗!!!血的教训)spa
这时蒙层设置样式:code
.home-list-nav-menu-mask { position: absolute; // fixed换为absolute top: 0; bottom: 0; width: 100%; height: 100%; background-color: #000; opacity: 0.35; z-index: 86; }