js实现按钮链接定时切换特效,超过一定的时间就切换为另一个链接,可根据您自己的需求来自定义链接及切换时间。
<html> <head> <meta http-equiv="Content-Language" content="zh-cn"> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta name="keywords" content="武鸣人网站,武鸣信息网,武鸣本地网,武鸣信息资源平台,减肥,健身,励志,励志语录,js特效,网页特效,www.wuming.ren"> <meta name="description" content="欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。"> <title>按钮上链接定时切换,武鸣人欢迎您。</title> <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] } }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) 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("武鸣人|https://wuming.ren", "Microsoft|https://www.wuming.ren/c5.html", "武鸣人1号|https://www.wuming.ren/c4.html", "IBM|https://www.wuming.ren/c3.html", "Yahoo|https://www.wuming.ren/c2.html", "Excite|https://www.wuming.ren/a/1141.html", "Hotbot|https://www.wuming.ren/a/1173.html", "GrapeJam|https://www.wuming.ren/6.html", "Email|mailto:305686263@qq.com" ); showTimer(); }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) 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); }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) // end --> </SCRIPT> <body onLoad="window.startTimer()"> <a href="https://www.wuming.ren">武鸣人</a>,各种信息资源免费发布,分享励志语录经典短句,减肥健身常识,各种js特效代码。网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)<hr> <!--欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。--> <script type="text/javascript" src="https://www.wuming.ren/ad/tc.js"></script> <script type="text/javascript" src="https://www.wuming.ren/ad/a.js"></script> <FORM> <INPUT TYPE="button" VALUE=" WHERE TO? " NAME="goTo" onClick="window.goToUrl()"> </FORM> </body> </html>
本文来自武鸣人网站,转载请注明出处