七彩课堂[网页设计ASP.NET教程系列]
带链接的打字效果的新闻标题
   <html>
<head>
<title>带链接的打字效果的新闻标题</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
body{font-size:14px;font-weight:bold;}
</style>
</head>
<body>
最新内容:<a id="HotNews" href="" target="_blank"></a>
<SCRIPT LANGUAGE="JavaScript">
<!--
var NewsTime = 2000; //每条新闻的停留时间
var TextTime = 50; //新闻标题文字出现等待时间,越小越快

var newsi = 0;
var txti = 0;
var txttimer;
var newstimer;

var newstitle = new Array(); //新闻标题
var newshref = new Array(); //新闻链接

newstitle[0] = "瑞星杀毒软件Rav2007版最新病毒库升级包下载";
newshref[0] = "http://www.zewen.cn/article.asp?id=983";

newstitle[1] = "[原创音乐]《如果你是我眼里的一滴泪》";
newshref[1] = "http://www.zewen.cn/article.asp?id=969";

newstitle[2] = "[健康]夏季喝完盐水再喝糖水";
newshref[2] = "http://www.zewen.cn/article.asp?id=982";

newstitle[3] = "感叹:来经贸7周年了";
newshref[3] = "http://www.zewen.cn/article.asp?id=979";

newstitle[4] = "累,但快乐着……";
newshref[4] = "http://www.zewen.cn/article.asp?id=974";

function shownew()
{
//code by haiwa @2005-10-21 www.51windows.net
var endstr = "_"
hwnewstr = newstitle[newsi];
newslink = newshref[newsi];
if(txti==(hwnewstr.length-1)){endstr="";}
if(txti>=hwnewstr.length){
clearInterval(txttimer);
clearInterval(newstimer);
newsi++;
if(newsi>=newstitle.length){
newsi = 0
}
newstimer = setInterval("shownew()",NewsTime);
txti = 0;
return;
}
clearInterval(txttimer);
document.getElementById("HotNews").href=newslink;
document.getElementById("HotNews").innerHTML = hwnewstr.substring(0,txti+1)+endstr;
txti++;
txttimer = setInterval("shownew()",TextTime);
}
shownew();
//-->
</SCRIPT>
</body>
</html>

 
信息推荐
资讯中心 | 电子商务 | 搜索营销 | 设计学院 | 中医养生 | 养生保健 | 节日祝福 | 民俗文化 | 奇闻趣事
建站知识 | 人世百态 | 网站导航 | 传统节日 | 搜索热点 | 星座运势 | 趣闻轶事 | 祝福的话 | 短信大全
© 2023 QicaiSpace.Com