js实现文字不停向上滚动显示特效

2个月前 (05-25 16:55)阅读回复0
大陆
大陆
  • 管理员
  • 发消息
  • 注册排名1
  • 经验值5294
  • 级别管理员
  • 主题1058
  • 回复2
楼主

分享一款文字向上滚动特效代码,当用户的鼠标经过时文字暂停滚动,根据自己的需求来自定义文字和滚动速度。

<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">收集各种js特效代码</div><div align="center">欢迎光临www.wuming.ren</div></font>'
function start(){
if (document.all) return
if (document.getElementById){
document.getElementById("slider").style.visibility="show"
ns6marquee(document.getElementById('slider'))
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
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()
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
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()
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
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()
}
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
//  End -->
</script>
<body bgcolor="#fef4d9" onLoad='start()'>
<a href="https://www.wuming.ren">武鸣人</a>,各种信息资源免费发布,分享励志语录经典短句,减肥健身常识,各种js特效代码。网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)<hr>
<!--欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。-->
<script type="text/javascript" src="https://www.wuming.ren/ad/tc.js"></script>
<script type="text/javascript" src="https://www.wuming.ren/ad/a.js"></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>')
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
</script></span>
</body>


0
0
收藏0

本文来自武鸣人网站,转载请注明出处

本文地址:https://www.wuming.ren/a/1092.html

回帖

js实现文字不停向上滚动显示特效 期待您的回复!

取消
载入表情清单……
载入颜色清单……
插入网络图片

取消确定

图片上传中
编辑器信息
提示信息