第一步:请将下列原代码放入html文件的<head>和</head>之间:
<script>
<!--
lstart=160
loop=true
speed=350
pr_step=5
functionmakeobj(obj,nest){
nest=(!nest)?'':'document.'+nest+'.'
this.css=(document.layers)?
eval(nest+'document.'+obj):eval(obj+'.style')
this.scrollheight=document.layers?this.css.document.height:eval(obj+'.
offsetheight')
this.up=goup
this.obj=obj+"object"
eval(this.obj+"=this")
returnthis
}
functiongoup(speed){
if(parseint(this.css.top)>-this.scrollheight){
this.css.top=parseint(this.css.top)-pr_step
settimeout(this.obj+".up("+speed+")",speed)
}elseif(loop){
this.css.top=lstart
eval(this.obj+".up("+speed+")")
}
}
functionslideinit(){
oslide=makeobj('divnews','divcont')
oslide.css.top=lstart
oslide.up(speed)
}
onload=slideinit
//-->
</script>
注:其中lstart设置起始位置,loop设置是否循环,speed是滚动速度,pr_step设置间距。
第二步:请将下列代码放入html文件的任何地方,建议放在最后,就是</html>之后:
<divid="divcont" style="position:absolute;width:300;height:100;top:120;left:280; clip:rect(0,250,150,0)">
<divid="divnews"style="position:absolute;top:0;left:0">
<p>
</font>
<fontcolor="#408080">这是一个滚动看板</font>
<fontface="arial"color="#408080"><br>
</font>
<fontcolor="#408080">但并不是大家经常看到的</font>
<fontface="arial"color="#408080"><br>
</font>
<fontcolor="#408080">用</font>
<fontface="arial"color="#408080">
<font face="arial">java</font>
</font>
<fontcolor="#408080">实现的那种</font>
<fontface="arial"color="#408080"><br>
</font>
<fontcolor="#408080">它采用</font>
<fontface="arial"color="#408080">
<font face="arial">javacript</font>
</font><fontcolor="#408080">语言和</font>
<fontface="arial"color="#408080">
<fontface="arial">dhtml</font>
</font>
<fontcolor="#408080">的层</font>
<fontface="arial"color="#408080"><br>
</font>
<fontcolor="#408080">所以你看到的原代码</font>
<fontface="arial"color="#408080"><br>
</font>
<fontcolor="#408080">不需要固定在</font>
<fontface="arial" color="#408080">form</font>
<fontcolor="#408080">框里或者表格里</font>
<fontface="arial"color="#408080"><br>
</font>
<fontcolor="#408080">它是用的</font>
<fontface="arial"color="#408080">
<font face="arial">
<div></div>
</font><br>
</font>
<fontcolor="#408080">你可以把这段代码放在</font>
<fontface="arial"color="#408080"><fontface="arial">html<br>
</font>
</font>
<fontcolor="#408080">代码里的任何地方</font>
<fontface="arial"color="#408080"><br>
</font>
<fontcolor="#408080">都不会影响它出现的位置</font>
<fontface="arial"color="#408080"></p>
<p>
</font>
<fontcolor="#408080">这是一个用处很大的程序</font>
<font face="arial"color="#408080"><br>
</font>
<fontcolor="#408080">可以用在网页里作广告或则告示板</font>
<fontface="arial"color="#408080"><br>
</font>
<fontcolor="#408080">赶快</font>
<fontface="arial"color="#408080"><fontface="arial">copy</font></font>
<fontcolor="#408080">到你的主页里试试吧!</font>
<fontface="arial"color="#408080"></p>
</div></div>
注:其中的width,height,top,left可以按自己要求更改,文字也可以改为自己所需要的。
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器