爱易网
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 浏览次数:20197 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
<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; //-->
上一篇:狡猾的按钮特效
下一篇:年份自动更新
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
代工厂生活危机:“富士康们”何去何从?
苹果售后生态链乱象:供需失衡价钱不一
解读苹果收购Beats背后动机:库克在想什么?
马斯克的特斯拉能否保持好势头
微软大幅调整Bing在华策略:从高大上到接地气
神州泰岳雪上加霜:副总违规买卖遭罚
雅安地震 绝不宽恕应用人们爱心的骗子!
首批四款“官方”打车软件发布:均为安卓版本
Android版WhatsApp曝漏洞:聊天记录可被窃取
推荐阅读
更多>
618首日看京东阿里不同策略,鹿死谁手?
传运营商高层将变化 专家称需体制革新
微信收费形式三选一 腾讯或变身运营商
黑狐病毒疯传播 电脑管家首推 专杀工具
纸媒深探版权蓝海抗衡互联网的时机到来了
网络文学竞争白热化 百度多酷文学网上线
同程旅游融资后变土豪 如何烧钱占领市场?
聚美优品获基石投资1.5亿美金,IPO吃下定心丸
App Store严禁推送广告 运用面临大清洗
传苹果与雅虎协作信息提供 进一步摆脱谷歌
优酷土豆兼并一年:依然处于烧钱形状
苏宁双线同价遇难题:第一个吃螃蟹不轻松
流浪汉高考状元终于找到工作:月薪3000做程序员很满意
FB上广告费用昂贵而且效果不及Twitter
传三星为赢得新兴市场:推廉价版Note3
搜狐前副总编何毅加盟乐视 任车联网公司CEO
Docker Desktop 4.11 发布:支持虚拟桌面、Mac 权限更改和新扩展
苹果大中华区业绩回暖 中移动贡献或低于预期
前苹果顾问批判iPhone命名:不应加S
苹果已经允许开发者提交64位应用程序