精华区 [关闭][返回]

当前位置:网易精华区>>讨论区精华>>网络专区>>● 网站建设>>盖世神功 — 网站建设技术>>Java Script — 来一杯热咖啡>>文字垂直滚动的脚本

主题:文字垂直滚动的脚本
发信人: aqing()
整理人: microant(1999-08-02 12:13:50), 站内信件
源代码来自http://java2000.wol.com.cn
----------

将以下代码加入HTML的<BODY>区即可,你只需设置高度、宽度、连接和显示的内
容。
<script language="JavaScript1.2">

//设置marquee的宽度(in pixels)
var marqueewidth=250
//设置marquee的高度
var marqueeheight=80
//设置marquee的速度
var speed=2
//设置marquee的显示内容
var marqueecontents='<strong><big>Thank you for vis
iting Java2000Enjoy them... <br>
click here mail me!</big></stron
g>
'

if (document.all)
document.write('<marquee direction="up" scrollAmount='+speed+' style="
width:'+marqueewidth+';height:'+marqueeheight+'">'+marqueecontents+'</
marquee>')

function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
setTimeout("window.onresize=regenerate",450)
intializemarquee()
}
}

function intializemarquee(){
document.cmarquee01.document.cmarquee02.document.write(marqueecontents
)
document.cmarquee01.document.cmarquee02.document.close()
thelength=document.cmarquee01.document.cmarquee02.document.height
scrollit()
}

function scrollit(){
if (document.cmarquee01.document.cmarquee02.top>=thelength*(-1)){
document.cmarquee01.document.cmarquee02.top-=speed
setTimeout("scrollit()",100)
}
else{
document.cmarquee01.document.cmarquee02.top=marqueeheight
scrollit()
}
}

window.onload=regenerate2
</script>
  <ilayer width=&{marqueewidth}; height=&{marqueeheight}; name="cmarqu
ee01"> 
  <layer name="cmarquee02" width=&{marqueewidth}; height=&{marqueeheig
ht};></layer>
  </ilayer>

--
               ☆☆☆☆情教护花,以保护美眉为已任 ☆☆☆☆ 
              
     情教----亲情·友情·爱情·网情……          
              
     情教总坛--http://love21n.126.com
               
     个人主页--http://wort.126.com
   

※ 来源:.月光软件站 http://www.moon-soft.com.[FROM: 202.97.245.250]

[关闭][返回]