<p> <meta content="zh-cn" http-equiv="Content-Language" /> <meta content="text/html; charset=gb2312" http-equiv="Content-Type" /></p> <SCRIPT LANGUAGE="JavaScript"> <!-- begin var startTime =null; var timerID =null; var initial =new Date(); var pos =0; var menuItem =null; function initArray() { this.length = initArray.arguments.length for (var i = 0; i < this.length; i ) { this[i 1] = initArray.arguments[i] } } function parsemenuItem(data,num) { for(var i=0;i<data.length;i ) { if(data.substring(i,i 1)=="|") break; } if (num==0) return(data.substring(0,i)); else return(data.substring(i 1,data.length)); } function startTimer() { initial = new Date(); startTime=initial.getTime(); stopTimer(); menuItem = new initArray("Netscape|http://www.111cn.net", "Microsoft|http://www.microsoft.com", "微笑在线_网页特效|http://www.fun52.com/", "IBM|http://www.ibm.com", "Yahoo|http://www.yahoo.com", "Excite|http://www.excite.com", "Hotbot|http://www.hotbot.com", "GrapeJam|http://www.grapejam.com", "Email|mailto:laofz@21cn.com" ); showTimer(); } function stopTimer() { timerID=null; menuItem=null; //clearTimeout(timerID); } function showTimer() { pos= (pos == menuItem.length) ? 1 : pos 1; document.forms[0].elements[0].value=parsemenuItem(menuItem[pos],0); timerID=window.setTimeout('showTimer()',4000); } function goToUrl() { //parent.welcome.location=parsemenuItem(menuItem[pos],1); this.location=parsemenuItem(menuItem[pos],1); return (false); } // end --> </SCRIPT><!--第二步:把如下代码加入<body>区域中--> <form> <input type="button" onClick="window.goToUrl()" name="goTo" value=" WHERE TO? " /> </form> <!--第三步:把<body>中的内容改为:--> |