文字向上滚动效果
2009-06-29 19:07
183 查看
脚本说明:
第一步:把如下代码加入<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.onmouseover=new Function("ieslider.scrollAmount=0")
ieslider.onmouseout=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()'>
第一步:把如下代码加入<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.onmouseover=new Function("ieslider.scrollAmount=0")
ieslider.onmouseout=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()'>
相关文章推荐
- jquery 实现无间图片文字向上滚动效果
- jq 实现文字定时向上滚动效果
- jQuery插件实现文字无缝向上滚动效果代码
- js实现文字定时向上滚动效果_文字特效_js网页特效代码
- JS+CSS代码简洁的无间断文字向上滚动切换效果
- jquery插件之文字间歇自动向上滚动效果代码
- Jquery结合div+css实现文字间断停顿向上滚动效果
- jquery插件之文字间歇自动向上滚动效果代码
- jQuery实现的文字逐行向上间歇滚动效果示例
- 文字向上滚动效果
- Android自定义控件实现多行文字自动向上滚动轮播效果(伪文字轮播)
- jQuery插件实现文字无缝向上滚动效果代码
- jquery单行文字向上滚动效果示例
- jquery单行文字向上滚动效果的实现代码
- jquery单行文字向上滚动效果的实现代码
- android TextView向上滚动(模仿滚动文字广告效果)
- jquery单行文字向上滚动效果
- jquery单行文字向上滚动效果示例
- 文字上下滚动的效果
- TextView实现跑马灯效果(文字滚动)