Jquery实现遮罩层的简单实例(就是弹出DIV周围都灰色不能操作)

前端之家收集整理的这篇文章主要介绍了Jquery实现遮罩层的简单实例(就是弹出DIV周围都灰色不能操作)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

Jquery实现遮罩层的简单实例(就是弹出DIV周围都灰色不能操作)

Jquery遮罩层

<style type="text/css">

BgDiv{background-color:#e3e3e3; position:absolute; z-index:99; left:0; top:0; display:none; width:100%; height:1000px;opacity:0.5;filter: alpha(opacity=50);-moz-opacity: 0.5;}

DialogDiv{position:absolute;width:400px; left:50%; top:50%; margin-left:-200px; height:auto; z-index:100;background-color:#fff; border:1px #8FA4F5 solid; padding:1px;}

DialogDiv h2{ height:25px; font-size:14px; background-color:#8FA4F5; position:relative; padding-left:10px; line-height:25px;}

DialogDiv h2 a{position:absolute; right:5px; font-size:12px; color:#000000}

DialogDiv .form{padding:10px;}

DialogDiv2{position:absolute;width:400px; left:50%; top:50%; margin-left:-200px; height:auto; z-index:100;background-color:#fff; border:1px #8FA4F5 solid; padding:1px;}

DialogDiv2 h2{ height:25px; font-size:14px; background-color:#8FA4F5; position:relative; padding-left:10px; line-height:25px;}

DialogDiv2 h2 a{position:absolute; right:5px; font-size:12px; color:#000000}

DialogDiv2 .form{padding:10px;}

DialogDiv3{position:absolute;width:400px; left:50%; top:50%; margin-left:-200px; height:auto; z-index:100;background-color:#fff; border:1px #8FA4F5 solid; padding:1px;}

DialogDiv3 h2{ height:25px; font-size:14px; background-color:#8FA4F5; position:relative; padding-left:10px; line-height:25px;}

DialogDiv3 h2 a{position:absolute; right:5px; font-size:12px; color:#000000}

DialogDiv3 .form{padding:10px;}

<script language="javascript" type="text/javascript" src="jquery-1.4.2.min.js">
<script language="javascript" type="text/javascript">
function ShowDIV(thisObjID) {
$("#BgDiv").css({ display: "block",height: $(document).height() });
var yscroll = document.documentElement.scrollTop;
$("#" + thisObjID ).css("top","100px");
$("#" + thisObjID ).css("display","block");
document.documentElement.scrollTop = 0;
}

function closeDiv(thisObjID) {
$("#BgDiv").css("display","none");
$("#" + thisObjID).css("display","none");
}

以上这篇Jquery实现遮罩层的简单实例(就是弹出DIV周围都灰色不能操作)就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持编程之家。

原文链接:https://www.f2er.com/jquery/47278.html

猜你在找的jQuery相关文章