[thelist] VBScript output randomizer

Brian Cummiskey brian at hondaswap.com
Mon Aug 10 18:50:54 CDT 2009


Hi Jenni,


I would do something like this:

<%
Function RandomNumber(intHighestNumber)
	Randomize
	RandomNumber = Int(intHighestNumber * Rnd) + 1
End Function


'if you have 4 images, you would call it like this:

touse = RandomNumber(4)

%>

Then, touse will hold a value of 1,2,3, or 4.

using your css rules pre-defined, you can simply output like this:

<div class="dancer" id="dancer<%= touse %>"></div>



More information about the thelist mailing list