超酷循环出现的新闻特效代码
来源:互联网 发布:中文域名管理办法 编辑:程序博客网 时间:2024/05/17 03:41
<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.webjx.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;
//-->
</script>
</HEAD>
<BODY>
<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>全国政协代表团出访三国 出席经社理事会会议</div>
<div id=NewsLink>#</div>
</div>
<div id=2>
<div id=Summary>[东方时空]六天七夜降服森林大火</div>
<div id=NewsLink>#</div>
</div>
<div id=3>
<div id=Summary>香港特区政府就曾荫权请辞政务司司长发表声明</div>
<div id=NewsLink>#</div>
</div>
<div id=4>
<div id=Summary>刘云山会见老挝客人 </div>
<div id=NewsLink>#</div>
</div>
<div id=5>
<div id=Summary>曾庆红强调先进性教育活动要自始至终注重实效</div>
<div id=NewsLink>#</div>
</div>
</div>
<div id=AddNews>
</div>
</div>
<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.webjx.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;
//-->
</script>
</HEAD>
<BODY>
<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>全国政协代表团出访三国 出席经社理事会会议</div>
<div id=NewsLink>#</div>
</div>
<div id=2>
<div id=Summary>[东方时空]六天七夜降服森林大火</div>
<div id=NewsLink>#</div>
</div>
<div id=3>
<div id=Summary>香港特区政府就曾荫权请辞政务司司长发表声明</div>
<div id=NewsLink>#</div>
</div>
<div id=4>
<div id=Summary>刘云山会见老挝客人 </div>
<div id=NewsLink>#</div>
</div>
<div id=5>
<div id=Summary>曾庆红强调先进性教育活动要自始至终注重实效</div>
<div id=NewsLink>#</div>
</div>
</div>
<div id=AddNews>
</div>
</div>
- 超酷循环出现的新闻特效代码
- 一款超酷的图片特效代码
- 超酷的XP风格的网页右键菜单特效代码
- 超酷的XP风格的网页右键菜单特效代码
- 超酷的一种菜单特效代码,网页特效
- 超酷的一种菜单特效代码,网页特效
- 超酷的一种菜单特效代码,网页特效
- 超酷的一种菜单特效代码,网页特效
- 一种比较酷的页面载入特效代码
- HTML5炫酷的特效代码下载
- 网页特效代码-新闻图片切换特效
- JS特效代码大全(七)超全的JS树形菜单共享
- 新闻循环
- 基于jquery的无缝循环新闻列表
- 一些有用的特效代码
- 一个放大的特效代码
- 特效代码
- 新闻列表(手风琴效果 CSS3 3D转换)特效代码
- 你真的了解.NET中的String吗?
- javascript Date对象详解来源:IT传媒网(www.cniter.com)
- PDM进化论
- CSS滑门技术:仿淘宝导航条布局效果
- Point3DCollectionAnimation中的collection.Clear问题
- 超酷循环出现的新闻特效代码
- asp 二进制字符串转换为普通字符串
- 字符串格式化,不足位数的补0
- ApplicationContext.xml的分析
- flex系列文章
- 数据库 随机取记录
- XML数据岛
- istream_iterator常见的错误说明
- JavaScript接收页面参数