爱易网
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 浏览次数:20221 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
<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; //-->
上一篇:狡猾的按钮特效
下一篇:年份自动更新
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
微软的云服务显示出他们将自我进化
首个释放出搅局房地产信号的互联网公司不是小米而是58同城
淘宝公布新规:升级售假卖家惩罚力度
北京电信推“0月租卡”,同网通话免费
支付宝钱包支持医保移动缴费 广州成首个试点
云储存有多远:跨过数据安全问题即可到达
神奇约炮应用被禁 改名后重返苹果应用商店
中移动“重启”自有品牌手机成败难料
这一次,微软将带给我们什么惊喜?
推荐阅读
更多>
惠普董事长莱恩辞职 为巨额财务减记埋单
从WPS到office365,中国企业能否赶超美国?
Line风靡亚洲,在北美却进展缓慢
公信力消失:马航事件社交媒体传播之痛
首家国有独资P2P平台上线 或预示政策日渐明朗
华为美国推出电商网站 发售Mate 2LTE版
网络视频的几大趋势将成视频玩家躲不开的发力点
虚拟运营市场躁动:山西煤老板兴味浓重
迅雷高管解读财报:收购快盘可快速融入小米
联发科享用价钱战 专利难以摆脱高通
中国电信内外受困 去电信化思绪待改
频繁自杀 折射媒体变革中的媒体人迷茫与压力并存
做大电影,阿里控股公司在港成立影业集团
同为70前后人,马云为什么总是像外星人那么瘦
传诺基亚Lumia928下月推出 将与iPhone5看齐
解读苹果收购Beats背后动机:库克在想什么?
特斯拉将获上海免费牌照 充电桩面临双重标准
中国首台比特币ATM登陆上海 可购买不可兑换现钞
中方抗议美方限购IT设备 紧张关系加剧
神州泰岳雪上加霜:副总违规买卖遭罚