Js对联广告代码 怎么用
3个回答
展开全部
js代码直接放到你网站页面中他这里的对联显示的是ad1和ad2
你要是想显示层图片就直接ad1和ad2去掉放上<img src="显示图片地址">
<html>
<head>
<title>对联广告</title>
</head>
<script language="javascript">
function yidong()
{
var abc = document.getElementById("leftdiv");
var ab = document.getElementById("rightdiv");
abc.style.top = document.body.scrollTop;
ab.style.top = document.body.scrollTop;
setTimeout("yidong()",6);
}
</script>
<body onload="yidong()">
<div style="height:1600px;">内容显示层</div>
<div id="leftdiv" style="position:absolute;z-index:1; left:10px;" >
<img src="广告图片地址"></div>
<div id="rightdiv" style="position:absolute; right:10px; z-index:1;">
<img src="广告图片地址"></div>
</body>
</html>
你要是想显示层图片就直接ad1和ad2去掉放上<img src="显示图片地址">
<html>
<head>
<title>对联广告</title>
</head>
<script language="javascript">
function yidong()
{
var abc = document.getElementById("leftdiv");
var ab = document.getElementById("rightdiv");
abc.style.top = document.body.scrollTop;
ab.style.top = document.body.scrollTop;
setTimeout("yidong()",6);
}
</script>
<body onload="yidong()">
<div style="height:1600px;">内容显示层</div>
<div id="leftdiv" style="position:absolute;z-index:1; left:10px;" >
<img src="广告图片地址"></div>
<div id="rightdiv" style="position:absolute; right:10px; z-index:1;">
<img src="广告图片地址"></div>
</body>
</html>
展开全部
<!--以下为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 = 5;
var y = 165 ;
var diff = (document.body.scrollTop + y - document.all.AdLayer1.style.posTop)*.40;
var y = document.body.scrollTop + y - diff;
eval_r("document.all." + layerName + ".style.posTop = y");
eval_r("document.all." + layerName + ".style.posLeft = x");
setTimeout("MoveLeftLayer('AdLayer1');", 20);
}
function MoveRightLayer(layerName) {
var x = 5;
var y = 165;
var diff = (document.body.scrollTop + y - document.all.AdLayer2.style.posTop)*.40;
var y = document.body.scrollTop + y - diff;
eval_r("document.all." + layerName + ".style.posTop = y");
eval_r("document.all." + layerName + ".style.posRight = x");
setTimeout("MoveRightLayer('AdLayer2');", 20);
}
document.write("<div id=AdLayer1 style='position: absolute;visibility:hidden;z-index:1'><a href=连接地址 target=_blank ><img src=图片地址 border=0></a></div>"
+"<div id=AdLayer2 style='position: absolute;visibility:hidden;z-index:1'><a href=连接地址 target=_blank ><img src=图片地址 border=0></a></div>");
initEcAd()
把上面的代码另存为一个*.JS文件,然后在想实现此效果的页面<head></head>之间加上一列代码:
<SCRIPT FOR='EccoolAd' EVENT='fscommand()' LANGUAGE='JavaScript'>
AdLayer1.style.visibility='hidden';
AdLayer2.style.visibility='hidden';
</script>
<script src="/blog/ggao.js>";</script>
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 = 165 ;
var diff = (document.body.scrollTop + y - document.all.AdLayer1.style.posTop)*.40;
var y = document.body.scrollTop + y - diff;
eval_r("document.all." + layerName + ".style.posTop = y");
eval_r("document.all." + layerName + ".style.posLeft = x");
setTimeout("MoveLeftLayer('AdLayer1');", 20);
}
function MoveRightLayer(layerName) {
var x = 5;
var y = 165;
var diff = (document.body.scrollTop + y - document.all.AdLayer2.style.posTop)*.40;
var y = document.body.scrollTop + y - diff;
eval_r("document.all." + layerName + ".style.posTop = y");
eval_r("document.all." + layerName + ".style.posRight = x");
setTimeout("MoveRightLayer('AdLayer2');", 20);
}
document.write("<div id=AdLayer1 style='position: absolute;visibility:hidden;z-index:1'><a href=连接地址 target=_blank ><img src=图片地址 border=0></a></div>"
+"<div id=AdLayer2 style='position: absolute;visibility:hidden;z-index:1'><a href=连接地址 target=_blank ><img src=图片地址 border=0></a></div>");
initEcAd()
把上面的代码另存为一个*.JS文件,然后在想实现此效果的页面<head></head>之间加上一列代码:
<SCRIPT FOR='EccoolAd' EVENT='fscommand()' LANGUAGE='JavaScript'>
AdLayer1.style.visibility='hidden';
AdLayer2.style.visibility='hidden';
</script>
<script src="/blog/ggao.js>";</script>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
把js代码直接放到你网站页面中他这里的对联显示的是ad1和ad2
你要是想显示层图片就直接ad1和ad2去掉放上<img src="显示图片地址">
你要是想显示层图片就直接ad1和ad2去掉放上<img src="显示图片地址">
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询