标题:[求助]帮助小弟怎样实现这个功能
只看楼主
傲天游
Rank: 1
等 级:新手上路
帖 子:25
专家分:0
注 册:2006-3-11
 问题点数:0 回复次数:0 
[求助]帮助小弟怎样实现这个功能
我想在网页上实现动态对联效果。在HTML中加入下列代码:
以下代码加入<body>区域
<SCRIPT LANGUAGE="JavaScript">
<!--
//more javascript from http://3lian.com
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="d:/课程/图片/2.jpg"></div>"
+"<div id=AdLayer2 style='position: absolute;visibility:hidden;z-index:1'><img src="d:/课程/图片/3.jpg"></div>");
initEcAd()
//-->
</SCRIPT>
请各位高手看看错误在那里把(谢谢!!!!!)
搜索更多相关主题的帖子: 对联 visible blank function javascript 
2006-03-21 09:14



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-51726-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013876 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved