我的图片为什么不随滚动条移动呢??
这是我的代码<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/x...
这是我的代码
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
#Layer2 {
position:absolute;
left:305px;
top:85px;
width:34px;
height:8849px;
z-index:2;
}
-->
</style>
</head>
<body>
<!--首页飘动广告 begin -->
<DIV id=Layer1
style="Z-INDEX: 1; LEFT: 0px; WIDTH: 50px; POSITION: absolute; TOP: 30px; HEIGHT: 50px">
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD align=left style="font-size:12px"><A onclick=HideLayers();
href="javascript:void(null)">关闭</A></TD></TR>
<TR>
<TD><IMG height=300 src="2006全国汽车拉力赛报道专题.files/ad_2.jpg"
width=100></TD></TR></TBODY></TABLE></DIV>
<SCRIPT language=JavaScript type=text/JavaScript>
lastScrollY=0;
function heartBeat(){
diffY=document.body.scrollTop;
percent=.3*(diffY-lastScrollY);
if(percent>0)
percent=Math.ceil(percent);
else
percent=Math.floor(percent);
document.getElementById("Layer1").style.pixelTop+=percent;
document.getElementById("Layer2").style.pixelTop+=percent;
lastScrollY=lastScrollY+percent;
}
window.setInterval("heartBeat()",1);
</SCRIPT>
<SCRIPT language=javascript>
var PIAOPIAO_AD_LEFT="";
var PIAOPIAO_AD_RIGHT="";
var layer2left = window.screen.width - 121;
document.getElementById("Layer2").style.left = layer2left;
function HideLayers(){
document.getElementById("Layer1").style.display = "none";
document.getElementById("Layer2").style.display = "none";
}
if (window.screen.width < 1024 )
{
HideLayers();
}
else
{
document.getElementById("Layer1").style.display = "";
document.getElementById("Layer2").style.display = "";
}
</SCRIPT>
</body>
</html> 展开
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
#Layer2 {
position:absolute;
left:305px;
top:85px;
width:34px;
height:8849px;
z-index:2;
}
-->
</style>
</head>
<body>
<!--首页飘动广告 begin -->
<DIV id=Layer1
style="Z-INDEX: 1; LEFT: 0px; WIDTH: 50px; POSITION: absolute; TOP: 30px; HEIGHT: 50px">
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD align=left style="font-size:12px"><A onclick=HideLayers();
href="javascript:void(null)">关闭</A></TD></TR>
<TR>
<TD><IMG height=300 src="2006全国汽车拉力赛报道专题.files/ad_2.jpg"
width=100></TD></TR></TBODY></TABLE></DIV>
<SCRIPT language=JavaScript type=text/JavaScript>
lastScrollY=0;
function heartBeat(){
diffY=document.body.scrollTop;
percent=.3*(diffY-lastScrollY);
if(percent>0)
percent=Math.ceil(percent);
else
percent=Math.floor(percent);
document.getElementById("Layer1").style.pixelTop+=percent;
document.getElementById("Layer2").style.pixelTop+=percent;
lastScrollY=lastScrollY+percent;
}
window.setInterval("heartBeat()",1);
</SCRIPT>
<SCRIPT language=javascript>
var PIAOPIAO_AD_LEFT="";
var PIAOPIAO_AD_RIGHT="";
var layer2left = window.screen.width - 121;
document.getElementById("Layer2").style.left = layer2left;
function HideLayers(){
document.getElementById("Layer1").style.display = "none";
document.getElementById("Layer2").style.display = "none";
}
if (window.screen.width < 1024 )
{
HideLayers();
}
else
{
document.getElementById("Layer1").style.display = "";
document.getElementById("Layer2").style.display = "";
}
</SCRIPT>
</body>
</html> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询