Metachecker.net
|
TrafficChecker.net
|
RankChecker.net
Learn Java Script Today
|
Over 5000 Free Fonts
|
Tutorials
|
Javascript Forum
|
Other Javascript Resources
|
Cheat Sheet
JavaScript Basics
Inserting Javascript
Complete Tutorial
Advance DHTML Tutorial
Script archive
Advanced Tutorials
Alert Scripts
Animation
Audio
Background Effects
Banner Ads
Browser Window
Buttons
Button Forms
Calculcators
Calendars
Clocks & Dates
Cookies
Cursor Effects
DHMTL Games
DHTML Miscellaneous
Equivalents
Forms
Games
IE4+ Scripts
IE5+ Scripts
Image Effects
Image Miscellaneous
Links & Buttons
Math Related
Messages Miscellaneous
Miscellaneous
Mouse Tricks
Navigation
Page Details
Password Protection
Pulldown Menus
Random Stuff
Scrolling
Status Bar
Text Animation
User Detail
User Info
Window Control
Switching Button
[View Sample]
Go ahead and click me, I'll take you to the link that's showing on the button!
Insert into <HEAD>
<script language="JavaScript"> <!-- Hide from old browsers // 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("DESCRIPTION #1|LINK #1", "DESCRIPTION #2|LINK #2", "DESCRIPTION #3|LINK #3", "DESCRIPTION #4|LINK #4", "DESCRIPTION #5|LINK #5", "DESCRIPTION #6|LINK #6", "DESCRIPTION #7|LINK #7", "DESCRIPTION #8|LINK #1" ); 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()',1500); } function goToUrl() { //parent.welcome.location=parsemenuItem(menuItem[pos],1); this.location=parsemenuItem(menuItem[pos],1); return (false); } // --> </SCRIPT>
Insert into <BODY>
<body onLoad="window.startTimer()"> <FORM> <INPUT TYPE="button" VALUE=" WHERE TO? " NAME="goTo" onClick="window.goToUrl()"> </FORM>
Other Options
You can increase or decrease the switching speed by playing with the numbers in the following line that goes in your head tag. timerID=window.setTimeout('showTimer()',1500);