js文字滚动效果
- 作者:arterwg 来源:蓝色理想 文章点击数:
最新内容:<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] = "世界银行公布世界最富和最穷国家前10";
newshref[0] = "http://www.111cn.cn/data/files/file_695.asp";
newstitle[1] = "安全经过广州火车站攻略";
newshref[1] = "http://www.111cn.cn/data/files/file_682.asp";
newstitle[2] = "没有卖不出去的豆子";
newshref[2] = "http://www.111cn.cn/data/files/file_686.asp";
newstitle[3] = "人类为何活不到自然寿命";
newshref[3] = "http://www.111cn.cn/data/files/file_680.asp";
newstitle[4] = "没人会踢一只死狗";
newshref[4] = "http://www.111cn.cn/data/files/file_685.asp";
function shownew()
{
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>

- 上一篇:很酷实用的右键弹出菜单
- 下一篇:最新北京奥运官方网站幻灯片切换效果
- 相关文章
| ·最新北京奥运官方网站幻灯片切换效果 | 08-12 |
| ·很酷实用的右键弹出菜单 | 08-11 |
| ·一个简单的相册效果,简单但兼容性好 | 08-02 |
| ·一个图片展示效果 | 08-01 |
| ·一个弹出窗口的小效果 | 08-01 |
| ·JS 鼠标事件 导航栏不用点击展开菜单 | 07-29 |
| ·功能强大,代码简单的管理菜单 | 07-26 |
| ·分析yupoo站留言效果并对效果进行简单实现 | 07-26 |
