超级急...我的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 id= "Head1 "> <title>
产品信息展示
</title>
<SCRIPT LANGUAGE= "JavaScript ">
var showad = true;
var Toppx = 100; //上端位置
var AdDivW = 30; //宽度
var AdDivH = 300; //高度
var PageWidth = 780; //页面多少宽度象素下正好不出现左右滚动条
var MinScreenW = 1024; //显示广告的最小屏幕宽度象素
function scall()
{
if(!showad)
{
return;
}
if (window.screen.width <MinScreenW)
{
showad = false;
document.getElementById( "Javascript.LeftDiv ").style.display= "none ";
document.getElementById( "Javascript.RightDiv ").style.display= "none ";
return;
}
var Borderpx = ((window.screen.width-PageWidth)/2-AdDivW)/2;
document.getElementById( "Javascript.LeftDiv ").style.display= " ";
document.getElementById( "Javascript.LeftDiv ").style.top=document.body.scrollTop+Toppx;
document.getElementById( "Javascript.LeftDiv ").style.left=document.body.scrollLeft+Borderpx;
document.getElementById( "Javascript.RightDiv ").style.display= " ";
document.getElementById( "Javascript.RightDiv ").style.top=document.body.scrollTop+Toppx;
document.getElementById( "Javascript.RightDiv ").style.left=document.body.scrollLeft+document.body.clientWidth-document.getElementById( "Javascript.RightDiv ").offsetWidth-Borderpx;
}
function hidead()
{
showad = false;
document.getElementById( "Javascript.LeftDiv ").style.display= "none ";
document.getElementById( "Javascript.RightDiv ").style.display= "none ";
}
</SCRIPT>
</head>
<body class= "margin " onscroll= "scall() " onresize= "scall() " onload= "scall() ">
<form name= "form1 " method= "post " action= "Finance.aspx " id= "form1 ">
<div id= "Javascript.RightDiv " style= "position:absolute;border: 1px solid #336699;background-color:#EEEEE2;z-index:1000;width:100px;height:300px;top:-1000px;word-break:break-all;display:none; ">
<div align= "right " style= "background-image: url(../Images/GrayExplorer.gif);position:absolute;top:0px;right:0px;margin:2px;padding:2px;z-index:2000; ">
<Img ID= "Image4 " src= "../Images/arrow_sand_beveled.gif " Width= "5 " Height= "8px " />
<strong> 最新公告 </strong> <span onclick= "hidead() " style= "color:red;text-decoration:none;font-size:12px;cursor:pointer "> 关闭 </span>
</div>
<div> <table border= "0 ">
<tr>
<td> </td>
</tr>
<tr>
<td style= "width: 200px; height: 1px; background-color: #cccccc ">
</td>
</tr>
<tr>
<td style= "width: 3px; height: 82px ">
test <br/>
test <br/>
test <br/>
test <br/>
test <br/>
test <br/> test <br/> test
</td>
</tr>
</table>
</div>
</div>
<div id= "Javascript.LeftDiv " style= "position:absolute;border: 1px solid #336699;background-color:#EEEEE2;z-index:1000;width:100px;height:300px;top:-1000px;word-break:break-all;display:none; ">
<div align= "right " style= "background-image: url(../Images/GrayExplorer.gif);position:absolute;top:0px;right:0px;margin:2px;padding:2px;z-index:2000; ">
<Img ID= "Img1 " src= "../Images/arrow_sand_beveled.gif " Width= "5 " Height= "8px " />
<span onclick= "hidead() " style= "color:red;text-decoration:none;font-size:12px;cursor:pointer "> 关闭 </span>
</div>
<div> <br> <table border= "0 ">
<tr>
<td style= "background-image: url(../Images/GrayExplorer.gif); width: 200px; height: 22px " align= "left ">
<img id= "Image5 " src= "../Images/arrow_sand_beveled.gif " style= "height:8px;width:5px;border-width:0px; " />
<strong> 资讯服务 </strong> </td>
</tr>
<tr>
<td style= "width: 200px; height: 1px; background-color: #cccccc ">
</td>
</tr>
<tr>
<td style= "width: 3px; height: 85px ">
test <br/>
test <br/>
test <br/>
test <br/>
test <br/>
test <br/> test <br/> test
</td>
</tr>
</table> </div>
</div>
<div>
</form>
test <br/>
</body>
</html>
[解决办法]
document.body.scrollTop它的值一直是0.
[解决办法]
我测试了,动的啊