javascript 层的显示和隐藏
<html><head><script>varns=(document.layers)?true:false;varie=(document.all)?true:fals...
<html>
<head>
<script>
var ns=(document.layers) ? true : false;
var ie=(document.all) ? true:false;
var block;
if(ns) block=document.layer1;
if(ie)block=layer1.style;
var boolvisible=true;
function showfunc(var obj)
{
if(ns)
{
obj.visibility="show";
}
if(ie)
{
obj.visibility="visible";
}
}
function hidefunc(var obj)
{
if(ns)
{
obj.visibility="hide";
}
if(ie)
{
obj.visibility="hidden";
}
}
function change()
{
if(boolvisible)
{
showfunc(block);
}
else
{
hidefunc(block);
}
boolvisible=!boolvisible;
}
</script>
</head>
<body onload="setInterval('change()',1000)">
<div id=layer1 style="position:absolute; left:200; top:100">显示和隐藏块</div>
</body>
</html> 展开
<head>
<script>
var ns=(document.layers) ? true : false;
var ie=(document.all) ? true:false;
var block;
if(ns) block=document.layer1;
if(ie)block=layer1.style;
var boolvisible=true;
function showfunc(var obj)
{
if(ns)
{
obj.visibility="show";
}
if(ie)
{
obj.visibility="visible";
}
}
function hidefunc(var obj)
{
if(ns)
{
obj.visibility="hide";
}
if(ie)
{
obj.visibility="hidden";
}
}
function change()
{
if(boolvisible)
{
showfunc(block);
}
else
{
hidefunc(block);
}
boolvisible=!boolvisible;
}
</script>
</head>
<body onload="setInterval('change()',1000)">
<div id=layer1 style="position:absolute; left:200; top:100">显示和隐藏块</div>
</body>
</html> 展开
2个回答
展开全部
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询