喜悦国际村 
» 游客:  注册 | 登录 | 搜索 | 统计 | 帮助

RSS 订阅当前论坛  

喜悦证交所已经关闭

上一主题 下一主题
     
标题: [经验] 看我弄这个破特效 循环显示 文字  
 
c1a1o1
版主
Rank: 7Rank: 7Rank: 7
一品带刀护卫


UID 68669
精华 0
积分 8935
帖子 2356
金钱 8935 喜悦币
威望 0
人脉 0
阅读权限 100
注册 2006-2-17
状态 离线
看我弄这个破特效 循环显示 文字

最新内容:<span id="HotNews"></span>
<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] = "red";

newstitle[1] = "安全经过广州火车站攻略";
newshref[1] = "green";

newstitle[2] = "没有卖不出去的豆子";
newshref[2] = "red";

newstitle[3] = "人类为何活不到自然寿命";
newshref[3] = "green";

newstitle[4] = "没人会踢一只死狗";
newshref[4] = "red";

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").style.color=newslink;
        document.getElementById("HotNews").innerHTML = hwnewstr.substring(0,txti+1)+endstr;
        txti++;
        txttimer = setInterval("shownew()",TextTime);
}
shownew();
//-->
</SCRIPT>




生日礼物送什么www.feichanglipin.cn
生日礼物      补肾
2008-7-16 04:59 PM#1
查看资料  Blog  发短消息  QQ . .   顶部
 
c1a1o1
版主
Rank: 7Rank: 7Rank: 7
一品带刀护卫


UID 68669
精华 0
积分 8935
帖子 2356
金钱 8935 喜悦币
威望 0
人脉 0
阅读权限 100
注册 2006-2-17
状态 离线
[推荐阅读] mysql有没有自动重建索引的工具?
最新内容:<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>




生日礼物送什么www.feichanglipin.cn
生日礼物      补肾
2008-7-16 05:00 PM#2
查看资料  Blog  发短消息  QQ . .   顶部
 
c1a1o1
版主
Rank: 7Rank: 7Rank: 7
一品带刀护卫


UID 68669
精华 0
积分 8935
帖子 2356
金钱 8935 喜悦币
威望 0
人脉 0
阅读权限 100
注册 2006-2-17
状态 离线
[推荐阅读] 我该做猎头怎么样?
村长这次 终于没有吃我的代码



生日礼物送什么www.feichanglipin.cn
生日礼物      补肾
2008-7-16 05:00 PM#3
查看资料  Blog  发短消息  QQ . .   顶部
 
km3945 (km3945)
版主
Rank: 7Rank: 7Rank: 7
版主


UID 46538
精华 0
积分 1327
帖子 1289
金钱 1327 喜悦币
威望 0
人脉 0
阅读权限 100
注册 2004-11-8
状态 离线
[推荐阅读] 北京PHP之真人CS团伙建立,欢迎加入!




学会用下半身来思考!
2008-7-17 09:01 AM#4
查看资料  Blog  发短消息  QQ . .   顶部
     


  可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题 | 开通个人空间  


 




Powered by Discuz! 6.1.0  © 2001-2010 Comsenz Inc.
Processed in 0.024127 second(s), 6 queries

(冀ICP备05009913号) 管理员:sadly 邮箱/MSN: sadly@phpx.com QQ:824008(长隐) 清除 Cookies - - Archiver - WAP