$(“#BigDiv”).data(“divbox_selectlist”).show();
$(“#BigDiv”).remove();
}
});
$.extend(
{
PageSize:function ()
{
var width=0;
var height=0;
width=window.innerWidth!=null?window.innerWidth:document.documentElement&&document.documentElement.clientWidth?document.documentElement.clientWidth:document.body!=null?document.body.clientWidth:null;
height=window.innerHeight!=null?window.innerHeight:document.documentElement&&document.documentElement.clientHeight?document.documentElement.clientHeight:document.body!=null?document.body.clientHeight:null;
return {Width:width,Height:height};
}
,ScrollPosition:function ()
{
var top=0,left=0;
if($.browser.mozilla)
{
top=window.pageYOffset;
left=window.pageXOffset;
}
else if($.browser.msie)
{
top=document.documentElement.scrollTop;
left=document.documentElement.scrollLeft;
}
else if(document.body)
{
top=document.body.scrollTop;
left=document.body.scrollLeft;
}
return {Top:top,Left:left};
}
});
(2) 网页中需引用两个js, jquery.divbox.js 和 jquery.js
(3) 测试页面代码:
<html>
<head>
<title>测试</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″>
<script type=”text/javascript” src=”js/jquery.js”></script>
<script type=”text/javascript” src=”js/jquery.divbox.js”></script>
<style>
#divSCA
{
position: absolute;
width: 700px;
height: 500px;
font-size: 12px;
background: #fff;
border: 0px solid #000;
z-index: 10001;
display: none;
}
</style>
<script type=”text/javascript”>
function openDiv() {
$(“#divSCA”).OpenDiv();
}
function closeDiv() {
$(“#divSCA”).CloseDiv();
}
</script>
</head>
<body>
<div id=”divSCA”>
<font size=”50″>这是模态DIV,点击关闭</font>
<input type=”button” value=”关闭” onclick=”closeDiv()”>
</div>
<input type=”button” value=”弹出” onclick=”openDiv()”/>
测试能否覆盖 select
<select>
<option>测试1</option>
<option>测试2</option>
<option>测试3</option>
</select>
</body>
</html>
(4) 测试代码及源文件下载地址:
点击下载










