Okay I've scoured Google and this forum but haven't found what I need or anything similiar (even though this shouldn't be too tough).
What I have is a script that displays 3 of 5 div areas on a web page.
The problem is that whenever math.random returns the same number it obviously won't keep to my 'showing 3 items at all times' model and just displays 2 or 1 item(s).
The script:
function randomize(){
var rand = 0;
var num = 0;
rand = Math.round(Math.random() * 5);
num = rand;
document.getElementById('c'+rand).style.display='';
}
I also have a script that loops 3 times through the random method:
function startRand(){
var many = 3;
for(var i=0;i<many;i++){
randomize();
}
}
Thanks in advance!



Reply With Quote
) and what I can't figure out with the javascript is how to set the variable to be remembered to exclude the number...
).


Bookmarks