当前位置:Gxlcms > html代码 > 求实现百度知道页面点登陆后出现背景灰色阴影后还能看到被覆盖的页面_html/css_WEB-ITnose

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

时间:2021-07-01 10:21:17 帮助过:20人阅读

要求在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 "

人气教程排行