您好,欢迎来到瑞奇养生。
搜索
您的当前位置:首页求实现百度知道页面点登陆后出现背景灰色阴影后还能看到被覆盖的页面_html/css

求实现百度知道页面点登陆后出现背景灰色阴影后还能看到被覆盖的页面_html/css

来源:瑞奇养生


要求在css和js下解决不知有没可能??
无标题文档点击注册求这能看到(要求灰色背景在的前提下)求这能看到(要求灰色背景在的前提下)求这也能看到


回复讨论(解决方案)

方法一
使用
opacity
filter
确实有遮罩的效果,即 页面的button click不能触发
产生的问题是, 遮罩层上的文字也会产生透明的效果

#ajax{ background-color: #CCCCCC; position: absolute; z-index: 9999; left: 0px; top: 0px; right: 0px; bottom: 0px;	opacity:.4;	filter:alpha(opacity=40);	}



方法2
使用 rgba + 渐变滤镜
ie下 遮罩不成功, button可以触发事件
但文字没有被影响为透明的。
#ajax{ background-color: #CCCCCC; position: absolute; z-index: 9999; left: 0px; top: 0px; right: 0px; bottom: 0px;	background-color:rgba(0,0,0,.4);	filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#4c000000', EndColorStr='#4c000000');}




可以用两个层来做,
弄个背景遮罩层,设置为透明,再弄个内容层,显示具体的内容。


div.style.height =document.body.clientHeight+"px"; //定位
div.style.width =document.body.clientWidth+"px";

div.style.filter = "alpha(opacity=50)"; //IE
div.style.opacity = ".50"; //chromeium

document.body.appendChild(div);
$('ajax').innerHTML="aaaaaaaaaaaaaaaa "

Copyright © 2019- rqyg.cn 版权所有

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务