左右两侧的广告代码 简单
function initEcAd(LName,RName) {
document.all.NowAd_left.style.posTop = -200;
document.all.NowAd_left.style.visibility = 'visible';
document.all.NowAd_left.style.position = 'absolute';
document.all.NowAd_right.style.posTop = -200;
document.all.NowAd_right.style.visibility = 'visible';
document.all.NowAd_right.style.position = 'absolute';
MoveLeftLayer(LName);
MoveRightLayer(RName);
}
function MoveLeftLayer(LName) {
var x = 5;
var y = 165;
LeftName=LName;
eval("var diff = (document.body.scrollTop + y - document.all." + LeftName + ".style.posTop)*.40");
var y = document.body.scrollTop + y - diff;
eval("document.all." + LeftName + ".style.posTop = y");
eval("document.all." + LeftName + ".style.posLeft = x");
setTimeout("MoveLeftLayer(LeftName);", 20);
}
function MoveRightLayer(RName) {
var x = 5;
var y = 165;
RightName=RName;
eval("var diff = (document.body.scrollTop + y - document.all." + RightName + ".style.posTop)*.40");
var y = document.body.scrollTop + y - diff;
eval("document.all." + RightName + ".style.posTop = y");
eval("document.all." + RightName + ".style.posRight = x");
setTimeout("MoveRightLayer(RightName);", 20);
}
document.write(""
+"");
initEcAd("NowAd_left","NowAd_right")
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]