Tulos

Koodi

Tämä tulee HEAD-osastoon

<script type="text/javascript">
// Original: Website Abstraction http://wsabstract.com
// Modified: Osmo Saarikumpu 2002-05-21

var count=0
function dothis(){
setTimeout("document.wheel.wheel2.selectedIndex =1000",100)
setTimeout("document.wheel.wheel2.selectedIndex =count",200)
setTimeout("document.wheel.wheel2.selectedIndex =1000",300)
setTimeout("document.wheel.wheel2.selectedIndex =count",400)
setTimeout("document.wheel.wheel2.selectedIndex =1000",500)
setTimeout("document.wheel.wheel2.selectedIndex =count",600)
setTimeout("window.location=document.wheel.wheel2.options[document.wheel.wheel2.selectedIndex].value",800)
}

function animate(){
var countfinal=Math.round(Math.random()*(document.wheel.wheel2.length-1))
document.wheel.wheel2.selectedIndex =count
if (count==countfinal){
dothis()
return
}
if (count<document.wheel.wheel2.length)
count++
else
count=0
setTimeout("animate()",150)
} 
</script>

Tämä tulee BODY-osastoon

<form action="javascript:void('0');" name="wheel" id="wheel">
<select name="wheel2" id="wheel2" size="4">
<option value="/js.htm">Javascript-sivu</option>
<option value="/dhtml.htm">DHTML-esimerkit</option>
<option value="/haut.htm">Hakusivut</option>
<option value="/avut.htm">Sekalaisia apuja</option>
</select>
<input type="button" value="Arvo linkki" name="B1" id="B1" onclick="animate()">
</form>
Weppipakin kotisivulle