js制作文字定时向上滚动特效

2周前 (04-26 20:06)阅读15回复0
大陆
大陆
  • 管理员
  • 发消息
  • 注册排名1
  • 经验值4194
  • 级别管理员
  • 主题838
  • 回复2
楼主

网站常用的文字定时滚动特效代码分享,可根据自己的需求来修改为文字向左或向下滚动,自定义滚动速度。

<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>
<style type="text/css">
#wwwwumingren{font-size:12px;color:#aa6;overflow:hidden;width:100px;height:20px;}
#wwwwumingren div{height:20px;line-height:20px;white-space:nowrap;overflow:hidden;}
</style>
<script type="text/javascript">
var tc;
window.onload=function(){
 var o=document.getElementById('wwwwumingren');hscroll(o);
 window.setInterval(function(){window.clearTimeout(tc);o.firstChild.style.marginLeft='0px';scrollup(o,20,0);},10000);
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
function scrollup(o,d,c){
 if(d==c){
  var t=o.firstChild.cloneNode(true);
  o.removeChild(o.firstChild);o.appendChild(t);
  t.style.marginTop=o.firstChild.style.marginTop='0px';
  hscroll(o);
 }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
 else{
  ch=false;var s=3,c=c+s,l=(c>=d?c-d:0);
  o.firstChild.style.marginTop=-c+l+'px';
  window.setTimeout(function(){scrollup(o,d,c-l)},50);
 }
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
function hscroll(o){
 var w1=o.firstChild.offsetWidth,w2=o.offsetWidth;
 if(w1<=w2)return;
 tc=window.setTimeout(function(){hs(o,w1-w2,0,w1-w2)},3500);
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
function hs(o,d,c,p){
 c++;var t=(c>0?-c:c);o.firstChild.style.marginLeft=t+'px';
 if(c==d){if(d==0){tc=window.setTimeout(function(){hs(o,p,0,p)},2500);}else tc=window.setTimeout(function(){hs(o,0,-p,p)},3500);}
 else tc=window.setTimeout(function(){hs(o,d,c,p)},5);
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
</script>
</head>
<body>
<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>
<div id="wwwwumingren"><div>武鸣人一号标题</div><div>武鸣人二号标题</div><div>武鸣人三号标题</div><div>武鸣人四号标题</div></div>
</body>
</html>


0
0
收藏0
回帖

js制作文字定时向上滚动特效 期待您的回复!

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

取消确定

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