[thelist] Re: Javascript: randomizing persistent text rotator

Timothy Martens timfm at hawaii.rr.com
Mon Mar 25 16:42:01 CST 2002


Chris Blessing wrote:

>You may want to code something to keep track of the last
>number generated, and then check that number to make
>sure you don't re-generate 2 "random" numbers in a row
>(it currently does that quite a bit, looks like it's
>pausing randomly).

Thanks Chris. Yes I noticed that, but wasn't sure why the frequent pause
was happening. How might I get started fixing this? I had assumed
Math.floor(Math.random()*txtStr.length) would prevent said behavior, but
I guess not.

Current version: http://home.hawaii.rr.com/timfm/theList/rotator_2.html

//t




More information about the thelist mailing list