In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article focuses on "how to use JavaScript to make link buttons constantly change", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to use JavaScript to make link buttons constantly change".
First, add the following program code to
< head > < /head >In the area.
< SCRIPT LANGUAGE="JavaScript" > < !-- begin // please help yourself to this code. 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("赛迪网Windows世界|http://www.ccidnet.com/school/system/", "赛迪网冲浪指南针|http://www.ccidnet.com/school/net/", "赛迪网软件下载园|http://www.ccidnet.com/school/soft/", "赛迪网办公自动化|http://www.ccidnet.com/school/office/", "赛迪网软件e学堂|http://www.ccidnet.com/school/software/", "赛迪网多媒体之家|http://www.ccidnet.com/school/multimedia/", "赛迪网培训与考试|http://www.ccidnet.com/school/exam/", "赛迪网电脑大词典|http://www.ccidnet.com/school/dict/" ); 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 >Note: the links and instructions above can be modified by yourself. 4000 in the above ('showTimer ()', 4000) is used to set the speed of change between links. The smaller the number, the faster the speed.
Add the following code to the
< body >In the area.
< FORM > < INPUT TYPE="button" VALUE=" zhouqing " NAME="goTo" onClick="window.goToUrl()" > < /FORM >Third, finally put
< body >Change the contents of the following code.
< body bgcolor="#ffffff" onLoad="window.startTimer()" >At this point, I believe you have a deeper understanding of "how to use JavaScript to make link buttons constantly change". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.