网页两边对联广告效果

来源:互联网 发布:广发证券 for mac 编辑:程序博客网 时间:2024/03/28 19:13

<SCRIPT LANGUAGE="JavaScript">
<!--
//more javascript from http://www.smallrain.net
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 = 5;
var y = 340;
var diff = (document.body.scrollTop + y - document.all.AdLayer1.style.posTop)*.40;
var y = document.body.scrollTop + y - diff;
eval("document.all." + layerName + ".style.posTop = parseInt(y)");
eval("document.all." + layerName + ".style.posLeft = x");
setTimeout("MoveLeftLayer('AdLayer1');", 20);
}
function MoveRightLayer(layerName) {
var x = 5;
var y = 340;
var diff = (document.body.scrollTop + y - document.all.AdLayer2.style.posTop)*.40;
var y = document.body.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'><img src=http://www.smallrain.net/jsimg/1yuan.gif></div>"
 +"<div id=AdLayer2 style='position: absolute;visibility:hidden;z-index:1'><img src=http://www.smallrain.net/jsimg/2yuan.gif></div>");
initEcAd()
//-->
</SCRIPT>

原创粉丝点击