PDA

View Full Version : Ultimate Slideshow not Random?



HyperD
01-29-2009, 07:09 PM
1) Script Title: Ultimate Fade-in slideshow (v1.51)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm

3) Describe problem:
I have an Array of four images, and the "R" parameter specified when I create the slideshow in my body, but it doesn't seem to randomize the order.
It also seems to do this on the DD page as well.

http://www.geocities.com/sprayfighter/images.html

jscheuer1
01-29-2009, 07:22 PM
Your page and the first demo on DD are random here. Perhaps you misunderstand. The show loads in a random order each time the page is visited or refreshed, except in some browsers when using the back button. And random means random, so it can load up several times in a row with the same order, each shuffling of the images can occur on any given page load. If you want to see greater variation, use more images.

But if you want the order to be random each time the 4 images have been shown, modifications would be required. It would still be possible to repeat a given sequence, just as I've already outlined when dealing with randomness. And in this new scenario, it would be fairly easy to repeat the same image twice in a row.

However it's a little worse than that, the javascript Math.random() method is not true randomness, repeated enough times a pattern will emerge, or at least a preferred order that will repeat more often than others. But this generally is not all that noticeable in this type of application, though the fewer images, the more likely it is to be noticed.