兼容多种浏览器文字定时向上滚动特效

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

分享一款实用的文字向上滚动特效,几行文字定时向上滚动显示,这个文字滚动特效基本兼容所有浏览器,根据自己的需求来修改即可。

<style type="text/css">
#up_wuming{border:1px solid #ccc;width:170px;height:82px;line-height:20px;overflow:hidden;}
#up_wuming #up_li{list-style-type:none;margin:0;padding:0;margin-left:6px;}
/*系统支持ie8就选line-height:16px;,但不支持opera 否则选line-height:20px;*/
#up_wuming #up_li a{font-size:12px; line-height:16px;}
</style>
<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="up_wuming">
<div id="marqueebox">
<div id="up_li"><a href="https://www.wuming.ren" target="_blank"><span style="color:#FF0000">滚动文字一号</span></a> <a href="https://www.wuming.ren" target="_blank"><span style="color:#FF0000">滚动文字二号</span></a></div>
<div id="up_li"><a href="https://www.wuming.ren" target="_blank"><span style="color:#3333FF">滚动文字三号</span></a> <a href="https://www.wuming.ren" target="_blank"><span style="color:#3333FF">滚动文字四号</span></a></div>
<div id="up_li"><a href="https://www.wuming.ren" target="_blank"><span style="color:#3333FF">滚动文字五号</span></a> <a href="https://www.wuming.ren" target="_blank"><span style="color:#3333FF">滚动文字六号</span></a></div>
<div id="up_li"><a href="https://www.wuming.ren" target="_blank"><span style="color:#3333FF">滚动文字七号</span></a> <a href="https://www.wuming.ren" target="_blank"><span style="color:#3333FF">滚动文字八号</span></a></div>
<script language="javascript">
function startmarquee(lh,speed,delay) {
var p=false;
var t;
var o=document.getElementById("marqueebox");
o.innerHTML+=o.innerHTML;
o.style.marginTop=0;
o.onmouseover=function(){p=true;}
o.onmouseout=function(){p=false;}
//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
function start(){
t=setInterval(scrolling,speed);
if(!p) o.style.marginTop=parseInt(o.style.marginTop)-1+"px";
}
//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
function scrolling(){
if(parseInt(o.style.marginTop)%lh!=0){
o.style.marginTop=parseInt(o.style.marginTop)-1+"px";
if(Math.abs(parseInt(o.style.marginTop))>=o.scrollHeight/2) o.style.marginTop=0;
}else{
clearInterval(t);
setTimeout(start,delay);
}
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
setTimeout(start,delay);
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
startmarquee(20,20,1500);
</script>


0
0
收藏0

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

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

回帖

兼容多种浏览器文字定时向上滚动特效 期待您的回复!

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

取消确定

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