Radio Buttons Sequence

[Total: 0    Average: 0/5]

This shows how to have a dot flow from radio buttons.

Body Code:

<SCRIPT LANGUAGE="JavaScript">
<!--
setTimeout('animate()',5);
// create row of radio buttons
lay(24)
// set index of lamp to start animation
var current = 0
// set speed (pause in milliseconds between each movement)
var speed = 100
function lay(num) {
	// assign "greater than" character to variable
	var gt = unescape("%3e")
	// open form
	document.write("<FORM NAME='animation'" + gt)
	// use loop to lay radio buttons down (all buttons in same group)
	for (var i = 0; i < num; ++i) {
		document.write("<INPUT TYPE='radio' NAME='lamps'" + gt)
	}
	// close form
	document.write("</FORM" + gt)
}
function animate() {
	// click next radio button
	document.animation.lamps[current].click()
	// if radio button is the last one reset variable to 0 (otherwise increment)
	current = (current == document.animation.lamps.length - 1) ? 0 : ++current
	// recursive call after speed milliseconds
	timerID = setTimeout("animate()", speed)
}
// -->
</SCRIPT>

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *