首页  >  文章  >  web前端  >  CSS的在安卓手机上做遮罩层的问题_html/css_WEB-ITnose

CSS的在安卓手机上做遮罩层的问题_html/css_WEB-ITnose

WBOY
WBOY原创
2016-06-24 11:47:031762浏览

我的大体框架

是一个 主的DIV,宽高100%,位置fixed,z-index:很大很大
然后一个显示的div,垂直居中.位置fixed。

但是这个能用了,在PC的浏览器看到是正常的,被遮罩的元素不能被点击,也不能被滚动...

但是放到手机里面,虽然被遮罩的元素不能被点击了, 为什么还是能被滚动的,意思就是页面太长的时候,还是可以滑动到下面去的。但是我看easyui的对话框是不能滑动的
这个怎么处理啊

 loadingshow: function (msg) {        if (!msg) {            msg = "加载中...";        }        var jContext = $('body');        var jLoad = $("#appLoading");            var msgDIV = new Array();            msgDIV.push('<div id="appLoading" style="position:fixed;width:100%;height:100%; font-size:18px;background:rgba(0,0,0,0.5);top:0;left:0;z-index:555555">');            msgDIV.push("<div id='lContext'><img  src='/App_Themes/Default/images/ajax-loader.gif'   style="max-width:90%" / alt="CSS的在安卓手机上做遮罩层的问题_html/css_WEB-ITnose" ><span id='sInfo' style='margin-left:8px;display:inline-block'>" + msg + "</span>");            msgDIV.push('</div></div>');            jLoad = $(msgDIV.join('')).appendTo(jContext);            var left = jContext.width() / 2 - jLoad.find('#sInfo').width() / 2 - 20;            var top = jContext.height() / 2 - jLoad.find('#sInfo').height() / 2;            jLoad.find("#lContext").css({ position: 'fixed', top: top, left: left, color: 'white', padding: '10px', margin: '10px'});        $("#appLoading").show();//有问题请删除    },


回复讨论(解决方案)

遮罩层像素请用百分比

遮罩层像素请用百分比



我上面的是百分比啊

弹出遮罩层时,限制主体高度至不会出现滚动条,如果没有透明效果的话甚至可以将主体隐藏

取消 touchmove 事件

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn