javescript 的怪问题

来源:百度知道 编辑:UC知道 时间:2024/06/18 04:39:54
javescript 的怪问题

这是我自己做的一个通用div仿alert的效果
function poph()
{
///隐藏层列表
document.getElementById("popbox").style.display='none';
document.getElementById("pop1").style.display='none';
document.getElementById("pop2").style.display='none';
}

function pops(e,w,h)
{
poph;////先全部隐藏
///开始显示层变量
//alert(id);
var pbox=document.getElementById("popbox");
var p=document.getElementById(e);
var bgcolors="#777";

//
pbox.style.position="absolute";
pbox.style.left="0";
pbox.style.top ="0";
pbox.style.width="100%";
pbox.style.height=screen.height;
pbox.style.top="0";
pbox.style.left="0";
pbox.style.background=bgcolors;
pbox.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=95)";
pbo

你这是第二个div把第一个div盖住了。。。我帮你改了一下,2个div位置不一样就看出问题了

<script>
function poph()
{
///隐藏层列表
document.getElementById("popbox").style.display='none';
document.getElementById("pop1").style.display='none';
document.getElementById("pop2").style.display='none';
}

function pops(e,w,h,t)
{
poph();////先全部隐藏
///开始显示层变量
//alert(id);
var pbox=document.getElementById("popbox");
var p=document.getElementById(e);
var bgcolors="#777";

//
pbox.style.position="absolute";
pbox.style.left="0";
pbox.style.top ="0";
pbox.style.width="100%";
pbox.style.height=screen.height;
pbox.style.top="0";
pbox.style.left="0";
pbox.style.background=bgcolors;
pbox.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,fini