广告代码怎么不浮动?
版主请看:我在首页模板中插入了一段对联广告代码.虽能正常显示.但是不上下浮动,代码如下:
<script language=javascript>
ad_l='<a href="http://www.tiantian.net" target=_blank><img border="0" src="ads/20071456151269.gif" width="100" height="300"
title="互联优惠大酬宾"></a>';ad_r='<a href="http://www.tiantian.net" target=_blank><img border="0"
src="ads/20071456151269.gif" width="100" height="300" title="互联优惠大酬宾"></a>';
function close163news()
{
searchspe.style.visibility='hidden';
searchspe2.style.visibility='hidden';
}
var specialcode="<DIV id=searchspe style='Z-INDEX: 100; right: 6px; POSITION: absolute; TOP: 85px;'><TABLE cellSpacing=0
cellPadding=0 width=100 style='font-size:12px;color:#ffffff'><TR bgcolor=#C54A00><TD height=20> ↓</TD><TD
style='CURSOR: hand' onclick='close163news()' width=30>关 闭</TD></TR></TABLE><table border='0' width='100' cellspacing='0'
cellpadding='0'><tr><td>"+ad_r+"</td></tr></table></DIV>";
document.write(specialcode);lastScrollX=0;
function heartBeat0()
{
diffY=document.body.scrollTop;percent=.1*(diffY-lastScrollX);
if(percent>0)percent=Math.ceil(percent);
else percent=Math.floor(percent);
document.all.searchspe.style.pixelTop+=percent;lastScrollX=lastScrollX+percent;
}
window.setInterval("heartBeat0()",1);
var specialcode2="<DIV id=searchspe2 style='Z-INDEX: 100; left: 6px; POSITION: absolute; TOP: 85px;'><TABLE cellSpacing=0
cellPadding=0 width=100 style='font-size:12px;color:#ffffff'><TR bgcolor=#C54A00><TD height=20> ↓</TD><TD
style='CURSOR: hand' onclick='close163news()' width=30>关 闭</TD></TR></TABLE><table border='0' width='100' cellspacing='0'
cellpadding='0'><tr><td>"+ad_l+"</td></tr></table></DIV>";
document.write(specialcode2);lastScrollY=0;
function heartBeat1()
{
diffY=document.body.scrollTop;percent=.1*(diffY-lastScrollY);
if(percent>0)percent=Math.ceil(percent);
else percent=Math.floor(percent);
document.all.searchspe2.style.pixelTop+=percent;lastScrollY=lastScrollY+percent;
}
window.setInterval("heartBeat1()",1);
</script>
<link rel="bookmark" href="favicon.ico">
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" href="css.css"type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
var p,i,x;if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames.document; n=n.substring(0,p);}
if(!(x=d)&&d.all) x=d.all; for (i=0;!x&&i<d.forms.length;i++) x=d.forms;
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a))!=null){document.MM_sr=x; if(!x.oSrc) x.oSrc=x.src; x.src=a;}
}
</script>
是哪儿弄错了吗? :)
页:
[1]