Dette viser at det KAN virke (NB: Kun testet Firefox)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "
http://www.w3.org/TR/html4/strict.dtd"><html><head><meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<title>Multival</title><style>
.bold {width:30px;height:20px;background-color:#FF0000;text-align:center;font:bold 11pt verdana,sans serif;color:white;}
</style><script>
var hopper = new Array(-1,-1,-1,-1,-1,-1)
function startHop( nr )
{
if (hopper[ nr ] == -1)
{
hopper[ nr ] = setInterval(function() {hop(nr)} , 20)
document.getElementById("bold"+nr).style.backgroundColor="#006600"
}
}
function hop( nr )
{
var bold = document.getElementById("bold"+nr)
if (bold.getAttribute("retning") == "ned")
if (bold.offsetTop > 278)
bold.setAttribute("retning","op")
else
bold.style.top = (bold.offsetTop + 1)+"px"
else
if (bold.offsetTop < 2)
bold.setAttribute("retning","ned")
else
bold.style.top = (bold.offsetTop - 1)+"px"
bold.innerHTML = ""+bold.offsetTop
if (Math.floor(Math.random()*1000) == 1)
{
clearInterval( hopper[ nr ] )
hopper [nr ] = -1
bold.style.backgroundColor="#FF0000"
bold.innerHTML = ""+bold.offsetTop
}
}
</script></head><body>
<div style="position:absolute;top:0;left:0;width:400px;height:300px;border:2px dashed red;background-color:yellow;">
<div onclick="startHop(0)" retning="ned" class="bold" id="bold0" style="position:absolute;top:150px;left: 50px;">0</div>
<div onclick="startHop(1)" retning="ned" class="bold" id="bold1" style="position:absolute;top:150px;left:100px;">1</div>
<div onclick="startHop(2)" retning="ned" class="bold" id="bold2" style="position:absolute;top:150px;left:150px;">2</div>
<div onclick="startHop(3)" retning="ned" class="bold" id="bold3" style="position:absolute;top:150px;left:200px;">3</div>
<div onclick="startHop(4)" retning="ned" class="bold" id="bold4" style="position:absolute;top:150px;left:250px;">4</div>
<div onclick="startHop(5)" retning="ned" class="bold" id="bold5" style="position:absolute;top:150px;left:300px;">5</div>
</div></body></html>