文字向上滚动效果

脚本说明:
第一步:把如下代码加入<body>区域中
<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
//scroller width
var swidth=300

//scroller height
var sheight=100


//scroller's speed;
var sspeed=2

var wholemessage=''

//text: change to your own

wholemessage='<div align="center"><font face=Arial size=3 color="#ffffff">黄牛刺激买票人</DIV><div align="center">抚顺来的球迷老张怎么也没有想到,自己求爷爷告奶奶好不容易买到了十强赛的门票,但是在领票的时候却发现换票比求人买票还要费劲.</strong></DIV><div align="center"><strong>里面传出争吵声 </strong></DIV><div align="center">沈阳组委会这次的球票发售环节出现很多问题早已经不是新闻了</div><div align="center">编缉:飞毛腿</div></font>'

function start(){
if (document.all) return
if (document.getElementById){
document.getElementById("slider").style.visibility="show"
ns6marquee(document.getElementById('slider'))
}
else if(document.layers){
document.slider1.visibility="show"
ns4marquee(document.slider1.document.slider2)
}
}
function ns4marquee(whichlayer){
ns4layer=eval(whichlayer)
ns4layer.document.write(wholemessage)
ns4layer.document.close()
sizeup=ns4layer.document.height
ns4layer.top-=sizeup
ns4slide()
}
function ns4slide(){
if (ns4layer.top>=sizeup*(-1)){
ns4layer.top-=sspeed
setTimeout("ns4slide()",100)
}
else{
ns4layer.top=sheight
ns4slide()
}
}
function ns6marquee(whichdiv){
ns6div=eval(whichdiv)
ns6div.innerHTML=wholemessage
ns6div.style.top=sheight
sizeup=sheight
ns6slide()
}
function ns6slide(){
if (parseInt(ns6div.style.top)>=sizeup*(-1)){
ns6div.style.top=parseInt(ns6div.style.top)-sspeed
setTimeout("ns6slide()",100)
}
else{
ns6div.style.top=sheight
ns6slide()
}
}
// End -->
</script>

<span style="borderWidth:1; borderColor:red; width:300; height:100;">
<ilayer width=300 height=100 name="slider1" bgcolor="black" visibility=hide>
<layer name="slider2" onMouseover="sspeed=0;" onMouseout="sspeed=2">
</layer>
</ilayer>
<script language="JavaScript">
if (document.all){
document.writeln('<marquee id="ieslider" scrollAmount=2 width=300 height=100 direction=up style="border:1 solid red;background-color:black">')
document.writeln(wholemessage)
ieslider.οnmοuseοver=new Function("ieslider.scrollAmount=0")
ieslider.οnmοuseοut=new Function("if (document.readyState=='complete') ieslider.scrollAmount=2")
document.write('</marquee>')
}
if (document.getElementById&&!document.all){
document.write('<div style="position:relative;overflow:hidden;width:300;height:100;clip:rect(0 302 102 0); background-color:black;border:1px solid red;" onMouseover="sspeed=0;" onMouseout="sspeed=2">')
document.write('<div id="slider" style="position:relative;width:&{swidth};">')
document.write('</div></div>')
}
</script></span>



第二步:请把<body>中的内容改为:
<body bgcolor="#fef4d9" onLoad='start()'>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值