对联广告,滚动条稍微动下就消失了
是asp的网页,js调用,滚动条稍微动下对联就消失了,并且提示script错误,js代码如下:function initEcAd() {
document.all.AdLayer1.style.posTop = -200;
document.all.AdLayer1.style.visibility = 'visible'
document.all.AdLayer2.style.posTop = -200;
document.all.AdLayer2.style.visibility = 'visible'
MoveLeftLayer('AdLayer1');
MoveRightLayer('AdLayer2');
}
function MoveLeftLayer(layerName) {
var x = 0;
var y = 80;
var diff = (document.documentElement.scrollTop + y - document.all.AdLayer1.style.posTop)*.80;
var y = document.documentElement.scrollTop + y - diff;
eval("document.all." + layerName + ".style.posTop = y");
eval("document.all." + layerName + ".style.posLeft = x");
setTimeout("MoveLeftLayer('AdLayer1');", 20);
}
function MoveRightLayer(layerName) {
var x = 0;
var y = 80;
var diff = (document.documentElement.scrollTop + y - document.all.AdLayer2.style.posTop)*.80;
var y = document.documentElement.scrollTop + y - diff;
eval("document.all." + layerName + ".style.posTop = y");
eval("document.all." + layerName + ".style.posRight = x");
setTimeout("MoveRightLayer('AdLayer2');", 20);
}
document.write("<div id=AdLayer1 style='position: absolute;visibility:hidden;z-index:1'><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='100' height='261' id=dl><param name='movie' value='images/top.swf'><param name='quality' value='high'><embed src='images/top.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='100' height='261'></embed></object></div>"
+"<div id=AdLayer2 style='position: absolute;visibility:hidden;z-index:1'><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='100' height='261' id=dl><param name='movie' value='images/top.swf'><param name='quality' value='high'><embed src='images/top.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='100' height='261'></embed></object></div>");
initEcAd();
document.write("<SCRIPT FOR='dl' EVENT='fscommand()' LANGUAGE='JavaScript'>");
document.write("AdLayer1.style.visibility='hidden';");
document.write("AdLayer2.style.visibility='hidden';");
document.write("</Script>");
希望能帮忙解答额