爱易网
IT新闻
IT新闻
爱易资讯
网站搭建
云虚拟主机教程
云服务器教程
Apache教程
IIS教程
Nginx教程
网站策划
站长文章
推广教程
淘宝客教程
网页设计
HTML教程
XHTML教程
CSS教程
HTML5教程
CSS3教程
JavaSript基础
JQuery教程
Node.js教程
前端技术
Ajax教程
Js特效
Xml教程
平面设计
页面UI设计
photoshop教程
程序开发
AI人工智能
Asp教程
Php教程
Asp.Net教程
Net Core教程
C#教程
Java教程
Jsp教程
开发技术
微信小程序教程
Uniapp开发教程
微信公众号开发
Andriod教程
IOS教程
DOS教程
Python教程
Docker教程
Windows Container教程
数据库
MSSQL教程
MySQL教程
Redis教程
Access教程
Oracle教程
数据库教程
操作系统
Linux教程
Windows教程
MAC教程
Cisco教程
交换机教程
防火墙教程
搜索
爱易网页
JS特效
多段文字多行逐段单个出现的特效
多段文字多行逐段单个出现的特效
日期:2014-05-18 浏览次数:20185 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
<HTML> <HEAD> <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(); } // --- 基础函数 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(); } } //more javascript from http://www.aiyiweb.com // --- 跳转下一条新闻 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; } 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; //-->
上一篇:狡猾的按钮特效
下一篇:年份自动更新
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
Line风靡亚洲,在北美却进展缓慢
北京电信推“0月租卡”,同网通话免费
同为70前后人,马云为什么总是像外星人那么瘦
小米移动芯片:英伟达退出,终会加强与联发科合作
电话用户9月实名制:运营商监管受质疑
“组合拳”怎么打 拆解小米新玩法
京东很忙:升服务推产品更新招股书 能赶在阿里前上市?
唯品会股价飙升 引天猫当当京东进军闪购
百视通:Xbox One汉化获批 游戏迷欢呼吧
推荐阅读
更多>
苹果音乐效劳新战略:与唱片商停止流媒体协作
工商总局开查电商“七日退货”
摩托罗拉移动裁员关闭德州Moto X手机工厂
微软为避免代理权争夺 与大股东达成和解协议
“论文查重”网店一月收入竟过百万
盛大游戏走向衰落的根源:免费游戏模式惹的祸
苹果CEO抱歉解读:是战略而非“屈服”
马云:银行若放开存款利率 余额宝死了也光荣
中国联通困局:遭遇OTT宽带4G三大难题
评论:阿里为什么不试着收购一家香港媒体呢
网曝富士康500万iphone遭退货是确证的事
2019双12阿里云老用户怎么参加拼团活动 老用户拼团方法
湘鄂情剥离餐饮业务进军大数据的底气在哪里?
阿朗力避步北电后尘 急切停止自我革新
总部大楼已换微软Logo:回忆诺基亚的兴衰史
三星手机在国内陷入困境:华为中兴小米紧追
传谷歌开发者大会发布Android 4.3 并非5.0版本
联想架构调整后:Think品牌或推智能手机
易迅大众点评缩水执行“七天后悔权”被约谈
猎豹移动上市押海外市场 与小米有合作空间