兼容火狐js文字定时向上滚动特效

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

分享一款文字定时向上滚动js特效代码,这个文字滚动特效能自定义滚动速度,并且兼容ie和火狐浏览器,结合自己的需求来修改即可。

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="keywords" content="武鸣人网站,武鸣信息网,武鸣本地网,武鸣信息资源平台,减肥,健身,励志,励志语录,js特效,网页特效,www.wuming.ren">
<meta name="description" content="欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。">
<title>兼容火狐js文字定时向上滚动特效_武鸣人</title>
</head>
<body bgColor="#ffffff" leftMargin="0" topMargin="3">
<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>
<script>
var marqueeContent=new Array(); //定义一个数组,用来存放显示内容
marqueeContent[0]='<A href="https://www.wuming.ren" onclick="reinitMarquee()">武鸣人滚动一号</FONT></A>';
marqueeContent[1]='<a href="https://wuming.ren" target="_blank">武鸣人滚动二号</a>';
marqueeContent[2]='<A href="https://wuming.ren" target="_blank">武鸣人滚动三号</a>';
marqueeContent[3]='<A href="https://wuming.ren" target="_blank">武鸣人滚动四号</a>';
marqueeContent[4]='<A href="https://wuming.ren" target="_blank">wuming滚动五号</a>';
marqueeContent[5]='<A href="https://wuming.ren" target="_blank">wuming滚动六号</a>';
marqueeContent[6]='<A href="https://wuming.ren" target="_blank">wuming.ren滚动七号</a>';
marqueeContent[7]='<A href="https://wuming.ren" target="_blank">wuming.ren滚动八号</a>';
marqueeContent[8]='<A href="https://wuming.ren" target="_blank">www.wuming.ren九号</a>';
marqueeContent[9]='<A href="https://wuming.ren" target="_blank">www.wuming.ren十号</a>';
marqueeContent[10]='<A href="https://wuming.ren" target="_blank">wuming武鸣十一号</a>';
marqueeContent[11]='<A href="https://wuming.ren" target="_blank">wuming武鸣十二号</a>';
var marqueeInterval=new Array(); //定义一些常用而且要经常用到的变量
var marqueeId=0;
var marqueeDelay=4000;
var marqueeHeight=18;
//接下来的是定义一些要使用到的函数
Array.prototype.random=function() {
var a=this;
var l=a.length;
for(var i=0;i<l;i++) {
var r=Math.floor(Math.random()*(l-i));
a=a.slice(0,r).concat(a.slice(r+1)).concat(a[r]);
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
return a;
}
function initMarquee() {
marqueeContent=marqueeContent.random();
var str='';
for(var i=0;i<Math.min(3,marqueeContent.length);i++) str+=(i>0?'  ':'')+marqueeContent[i];
document.write('<div id=marqueeBox style="overflow:hidden;height:'+marqueeHeight+'px" onmouseover="clearInterval(marqueeInterval[0])" onmouseout="marqueeInterval[0]=setInterval(\'startMarquee()\',marqueeDelay)"><div>'+str+'</div></div>');
marqueeId+=2;
if(marqueeContent.length>3)marqueeInterval[0]=setInterval("startMarquee()",marqueeDelay);
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
function reinitMarquee() {
js_scroll_content.src='scroll_content2.js';
marqueeContent=marqueeContent.random();
var str='';
for(var i=0;i<Math.min(3,marqueeContent.length);i++) str+=(i>0?'  ':'')+marqueeContent[i];
marqueeBox.childNodes[(marqueeBox.childNodes.length==1?0:1)].innerHTML=str;
marqueeId=2;
}
function startMarquee() {
var str='';
for(var i=0;(i<3)&&(marqueeId+i<marqueeContent.length);i++) {
str+=(i>0?'  ':'')+marqueeContent[marqueeId+i];
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
marqueeId+=3;
if(marqueeId>marqueeContent.length)marqueeId=0;
if(marqueeBox.childNodes.length==1) {
var nextLine=document.createElement('DIV');
nextLine.innerHTML=str;
marqueeBox.appendChild(nextLine);
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
else {
marqueeBox.childNodes[0].innerHTML=str;
marqueeBox.appendChild(marqueeBox.childNodes[0]);
marqueeBox.scrollTop=0;
}
clearInterval(marqueeInterval[1]);
marqueeInterval[1]=setInterval("scrollMarquee()",20);
}
function scrollMarquee() {
marqueeBox.scrollTop++;
if(marqueeBox.scrollTop%marqueeHeight==(marqueeHeight-1)){
clearInterval(marqueeInterval[1]);
}
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
initMarquee();
</script>
</body>
</html>


0
0
收藏0

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

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

回帖

兼容火狐js文字定时向上滚动特效 期待您的回复!

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

取消确定

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