Rotating-dropdown-link-javascript thingie code

2 Conversations

*****************
put this bit in the <HEAD>
*****************
<!-- Begin
function formHandler(form){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}
// End -->
</SCRIPT>





***************
put this bit in the <BODY>
***************
<Olli/>
<form id="form">
<select id="site" size=1>
<option value="http://www.h2g2.com/U56404">Mr Cynic
<option value="http://www.h2g2.com/U50758">Lisa the Freak
<option value="http://www.h2g2.com/U97351">Hammythamster
<option value="http://www.h2g2.com/U38889">_Jinx_
<option value="http://www.h2g2.com/U106694">Joanna
<option value="http://www.h2g2.com/U86204">Kimotocat
<option value="http://www.h2g2.com/U46995">YK
<option value="http://www.h2g2.com/userpage.cgi">You ;-)
</select>
<input type=button value="Visit" onClick="javascript:formHandler()">
</form>
<script language="javascript">
<!-- Begin
function rotate() {
menu = document.form.site;
chosen = menu.selectedIndex;
menu.selectedIndex= (chosen == (menu.length-1)) ? 0 : chosen + 1;
setTimeout("rotate()",4000);
}
rotate();
// End -->
</script>
************************************************
By Olli
editing the >>setTimeout("rotate()",4000);<< number changes the time in miliseconds it takes to switch users
I made this script without looking at Zis guy's
give me a medal><>

Bookmark on your Personal Space


Entry

A238952

Infinite Improbability Drive

Infinite Improbability Drive

Read a random Edited Entry


Written and Edited by

Disclaimer

h2g2 is created by h2g2's users, who are members of the public. The views expressed are theirs and unless specifically stated are not those of the Not Panicking Ltd. Unlike Edited Entries, Entries have not been checked by an Editor. If you consider any Entry to be in breach of the site's House Rules, please register a complaint. For any other comments, please visit the Feedback page.

Write an Entry

"The Hitchhiker's Guide to the Galaxy is a wholly remarkable book. It has been compiled and recompiled many times and under many different editorships. It contains contributions from countless numbers of travellers and researchers."

Write an entry
Read more