打字效果
来源:互联网 发布:mysql bit 对应java 编辑:程序博客网 时间:2024/04/28 04:35
- <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.getElementById("incoming").children.AllNews.children.length;//新闻总条数
- theAddNum = document.getElementById("incoming").children.AddNews.children.length;//补充条数
- totalNum =theNewsNum+theAddNum;
- theCurrentNews = 0;
- theCurrentLength = 0;
- theLeadString = " ";
- theSpaceFiller = " ";
- runTheTicker();
- }
- // --- 基础函数
- function runTheTicker(){
- if(theNewsState == 1){
- if(CurrentPosion<theNewsNum){
- setupNextNews();
- }
- else{
- setupAddNews();
- }
- CurrentPosion++;
- if(CurrentPosion>=totalNum||CurrentPosion>=1){
- CurrentPosion=0;//最多条数不超过num_gun条
- }
- }
- if(theCurrentLength != theNewsText.length){
- drawNews();
- }
- else{
- closeOutNews();
- }
- }
- // --- 跳转下一条新闻
- function setupNextNews(){
- theNewsState = 0;
- theCurrentNewstheCurrentNews = theCurrentNews % theNewsNum;
- theNewsText = document.getElementById("AllNews").children[theCurrentNews].children.Summary.innerText;
- theTargetLink = document.getElementById("AllNews").children[theCurrentNews].children.Summary.children[0].href;
- theCurrentLength = 0;
- document.all.hottext.href = theTargetLink;
- theCurrentNews++;
- }
- function setupAddNews() {
- theNewsState = 0;
- theCurrentNewstheCurrentNews = theCurrentNews % theAddNum;
- theNewsText = document.getElementById("AllNews").children[theCurrentNews].children.Summary.innerText;
- theTargetLink = document.getElementById("AllNews").children[theCurrentNews].children.Summary.children[0].href;
- theCurrentLength = 0;
- document.all.hottext.href = theTargetLink;
- theCurrentNews++;
- }
- // --- 滚动新闻
- function drawNews(){
- var myWidget;
- if((theCurrentLength % 2) == 1){
- myWidget = theWidgetOne;
- }
- else{
- myWidget = theWidgetTwo;
- }
- 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);
- }
- window.onload=startTicker;
- </SCRIPT>
- <a href="" id="hottext"></a>
- <div id=incoming style="DISPLAY: none;float:left">
- <div id=AllNews >
- <div id=0>
- <div id="Summary" style="border:1px solid red">
- <a href="http://p.dvbbs.net/dispbbs-11-0-1-20932-0-0-0" target="_blank"><font><b>众望所归 动网PHP 2.0正式发布</b></font></a>
- <a href="http://p.dvbbs.net/" target="_blank"><font color="red"><b>动网论坛PHP官方站点</b></font></a> </div>
- <div id=NewsLink ></div>
- </div>
- </div>
- <div id=AddNews height="25"></div>
- </div>
- 打字效果
- Javascript打字效果~
- Flash打字效果模板
- 打字效果的文字特效
- javascript 打字效果
- 打字效果代码
- JavaScript打字效果
- 打字效果代码
- js:打字效果代码
- JS实现打字效果
- JS实现打字效果
- 动画效果 打字延迟
- CSS 实现打字效果
- jQuery动态打字效果
- jquery实现打字效果
- Javascript实现打字效果
- js实现打字效果
- js 打字效果
- 包容有多少,拥有就有多少;
- 金陵集团选择Zoomla!逐浪CMS
- 软件的交流语言
- 国家计算机与软件资格考试因试卷丢失延考
- C语言编程艺术--条件编译
- 打字效果
- 在fedora 9下面如何安装amule
- [排行榜]广州儿科医生红黑榜
- Js模拟三角函数曲线
- 上下九
- 过夜
- 开始毕业设计
- 台湾业界:“大三通”将促两岸电子商务蓬勃发展
- 提供天气预报的Web Service接口