网站公告栏信息滚动展示特效

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

分享一款网站公告栏文字滚动显示特效,多段文字逐行弹出,自定义文字及弹出速度,网站中常用来做公告栏。

<HTML>
<HEAD>
<meta name="keywords" content="武鸣人网站,武鸣信息网,武鸣本地网,武鸣信息资源平台,减肥,健身,励志,励志语录,js特效,网页特效,www.wuming.ren">
<meta name="description" content="欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。">
<title>网站公告栏信息滚动展示特效_武鸣人</title>
<script language=JAVAscript>
<!--
// ------ 定义全局变量
var theNewsNum;
var theAddNum;
var totalNum;
var CurrentPosion=0;
var theCurrentNews;
var theCurrentLength;
var theNewsText;
var theTargetLink;
var theCharacterTimeout;
var theNewsTimeout;
var theBrowserVersion;
var theWidgetOne;
var theWidgetTwo;
var theSpaceFiller;
var theLeadString;
var theNewsState;
function startTicker()
{
// ------ 设置初始数值
theCharacterTimeout = 50;//字符间隔时间
theNewsTimeout     = 2000;//新闻间隔时间
theWidgetOne        =  "_";//新闻前面下标符1
theWidgetTwo        =  "-";//新闻前面下标符
theNewsState       = 1;
//theNewsNum        = document.body.children.incoming.children.NewsNum.innerText;//新闻总条数
//add by lin
theNewsNum        = document.getElementById("incoming").children.AllNews.children.length;//新闻总条数
theAddNum        = document.getElementById("incoming").children.AddNews.children.length;//补充条数
totalNum   =theNewsNum+theAddNum;
theCurrentNews     = 0;
theCurrentLength    = 0;
theLeadString       = " ";
theSpaceFiller      = " ";
runTheTicker();
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
// --- 基础函数
function runTheTicker()
{
if(theNewsState == 1)
{
if(CurrentPosion<theNewsNum){
setupNextNews();
}
else{
setupAddNews();
}
CurrentPosion++;
if(CurrentPosion>=totalNum||CurrentPosion>=5) CurrentPosion=0;  //最多条数不超过5条
}
if(theCurrentLength != theNewsText.length)
{
drawNews();
}
else
{
closeOutNews();
}
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
// --- 跳转下一条新闻
function setupNextNews()
{
theNewsState = 0;
theCurrentNews = theCurrentNews % theNewsNum;
theNewsText = document.getElementById("AllNews").children[theCurrentNews].children.Summary.innerText;
theTargetLink = document.getElementById("AllNews").children[theCurrentNews].children.NewsLink.innerText;
theCurrentLength = 0;
document.all.hottext.href = theTargetLink;
theCurrentNews++;
}
function setupAddNews()
{
theNewsState = 0;
theCurrentNews = theCurrentNews % theAddNum;
theNewsText = document.getElementById("incoming").children.AddNews.children[theCurrentNews].children.Summary.innerText;
theTargetLink = document.getElementById("incoming").children.AddNews.children[theCurrentNews].children.NewsLink.innerText;
theCurrentLength = 0;
document.all.hottext.href = theTargetLink;
theCurrentNews++;
}
// --- 滚动新闻
function drawNews()
{
var myWidget;
if((theCurrentLength % 2) == 1)
{
myWidget = theWidgetOne;
}
else
{
myWidget = theWidgetTwo;
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
document.all.hottext.innerHTML = theLeadString + theNewsText.substring(0,theCurrentLength) + myWidget + theSpaceFiller;
theCurrentLength++;
setTimeout("runTheTicker()", theCharacterTimeout);
}
// --- 结束新闻循环
function closeOutNews()
{
document.all.hottext.innerHTML = theLeadString + theNewsText + theSpaceFiller;
theNewsState = 1;
setTimeout("runTheTicker()", theNewsTimeout);
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
window.onload=startTicker;
//-->
</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>
<table>
<tr><td>
<div id=visible>武鸣人新闻公告:<a href="" id=hottext target="_blank"></a></div>
</td></tr>
</table>
<div id=incoming style="DISPLAY: none">
<div id=AllNews>
<div id=1>
<div id=Summary>11111武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢!</div>
<div id=NewsLink>https://www.wuming.ren</div>
</div>
<div id=2>
<div id=Summary>22222武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢</div>
<div id=NewsLink>https://www.wuming.ren</div>
</div>
<div id=3>
<div id=Summary>33333武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢!</div>
<div id=NewsLink>https://www.wuming.ren</div>
</div>
<div id=4>
<div id=Summary>44444武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢!</div>
<div id=NewsLink>https://www.wuming.ren</div>
</div>
<div id=5>
<div id=Summary>55555武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢!</div>
<div id=NewsLink>https://www.wuming.ren</div>
</div>
</div>
<div id=AddNews>
</div>
</div>
</BODY>
</HTML>


0
0
收藏0

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

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

回帖

网站公告栏信息滚动展示特效 期待您的回复!

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

取消确定

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