请问如果禁用背景... 就是用一个js特效作出来的相册展示,当单击一个图片,图片从中间弹出来...然后希望弹出来之后图片后面的背景全部被禁用,鼠标不能点击,而且整个页面除了弹出来的图片之后都变灰... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 lightbox~!嘿嘿,找找这个东西吧 <style type="text/css"><!--html,body {height:100%; margin:0px; font-size:12px;}.mydiv {background-color: #f9fff6;border: 1px solid #009900;text-align: center;line-height: 25px;font-size: 13px;font-weight: bold;z-index:99;width: 50px;height: 50px;left:0%;/*FF IE7*/top:0%;/*FF IE7*/margin-left:0px!important;/*FF IE7 half of its width */margin-top:0px!important;/*FF IE7 half of its height*/margin-top:0px;position:fixed!important;/*FF IE7*/position:absolute;/*IE6*/_top: 0:}.bg {background-color: #C2BEBF;width: 100%;height: 100%;left:0;top:0;/*FF IE7*/filter:alpha(opacity=40);/*IE*/opacity:0.4;/*FF*/z-index:1;position:fixed!important;/*FF IE7*/position:absolute;/*IE6*/_top: expression(eval(document.compatMode && document.compatMode=='CSS1Compat') ? documentElement.scrollTop + (document.documentElement.clientHeight-this.offsetHeight)/2 :/*IE6*/ document.body.scrollTop + (document.body.clientHeight - this.clientHeight)/2);/*IE5 IE5.5*/} --> </style><script language="javascript" type="text/javascript">function showDiv(){if(document.all){ document.getElementById('bg').innerHTML = "<iframe style='width:100%;height:100%;left:0px;top:0px;position:absolute;filter:alpha(opacity=0);z-index:-1;border:0px'/>";}document.getElementById('popDiv').style.display='block';document.getElementById('bg').style.display='block';}function closeDiv(){document.getElementById('popDiv').style.display='none';document.getElementById('bg').style.display='none';}</script><div id="popDiv" class="mydiv" style="display:none;" onclick="closeDiv()">关闭<br/><!--<a href="javascript:closeDiv()">close</a>--></div><div id="bg" class="bg" style="display:none;"></div><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>test</title></head><body onload="showDiv()"></body></html> 可以自己写个遮罩层, 通过z-index来把后面的东西挡住, 也可以找其他的扩展库, 如lightbox、thickbox等。 加个大层/*css*/#{background:#000;width: 100%;left:0;top:0;filter:alpha(opacity=40);/*IE*/opacity:0.4;/*FF*/z-index:1000;position:absolute}//JS$("#").css("height",$(document).height());其它的像图片展示层就你自己设置了<!--html--><body><div id=""></div><div id="图片展示区">图片展示区</div> 关于层的显示问题,IE与FOX里显示的情况不相同 如何实现跑马灯? 请问在javascript中如何连接mysql数据库? textarea值的输入与取得的问题! 子窗口onload事件写到父窗口怎样写? jquery的validate 里面怎么进行两个input必须有一个有值的验证? 手机通讯问题 如何得到网页里的控件的文本输入框的值? JS能做出显示本地硬盘目录的窗口嘛? 在javascript中顺序执行语句,如果前一句出现非语法错误,后一句还会执行吗? 帮忙修改一下悬浮脚本... 点击运行
<!--
html,body {height:100%; margin:0px; font-size:12px;}.mydiv {
background-color: #f9fff6;
border: 1px solid #009900;
text-align: center;
line-height: 25px;
font-size: 13px;
font-weight: bold;
z-index:99;
width: 50px;
height: 50px;
left:0%;/*FF IE7*/
top:0%;/*FF IE7*/margin-left:0px!important;/*FF IE7 half of its width */
margin-top:0px!important;/*FF IE7 half of its height*/margin-top:0px;position:fixed!important;/*FF IE7*/
position:absolute;/*IE6*/_top: 0:}
.bg {
background-color: #C2BEBF;
width: 100%;
height: 100%;
left:0;
top:0;/*FF IE7*/
filter:alpha(opacity=40);/*IE*/
opacity:0.4;/*FF*/
z-index:1;position:fixed!important;/*FF IE7*/
position:absolute;/*IE6*/
_top: expression(eval(document.compatMode &&
document.compatMode=='CSS1Compat') ?
documentElement.scrollTop + (document.documentElement.clientHeight-this.offsetHeight)/2 :/*IE6*/
document.body.scrollTop + (document.body.clientHeight - this.clientHeight)/2);/*IE5 IE5.5*/}
-->
</style>
<script language="javascript" type="text/javascript">
function showDiv(){
if(document.all){
document.getElementById('bg').innerHTML = "<iframe style='width:100%;height:100%;left:0px;top:0px;position:absolute;filter:alpha(opacity=0);z-index:-1;border:0px'/>";
}
document.getElementById('popDiv').style.display='block';
document.getElementById('bg').style.display='block';
}function closeDiv(){
document.getElementById('popDiv').style.display='none';
document.getElementById('bg').style.display='none';
}</script>
<div id="popDiv" class="mydiv" style="display:none;" onclick="closeDiv()">关闭<br/>
<!--<a href="javascript:closeDiv()">close</a>--></div>
<div id="bg" class="bg" style="display:none;"></div><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>test</title></head><body onload="showDiv()"></body>
</html>
background:#000;
width: 100%;
left:0;
top:0;
filter:alpha(opacity=40);/*IE*/
opacity:0.4;/*FF*/
z-index:1000;
position:absolute
}
//JS$("#").css("height",$(document).height());
其它的像图片展示层就你自己设置了<!--html-->
<body>
<div id=""></div>
<div id="图片展示区">图片展示区</div>