Results 1 to 2 of 2

Thread: Ultimate Slideshow not Random?

  1. #1
    Join Date
    Jan 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Ultimate Slideshow not Random?

    1) Script Title: Ultimate Fade-in slideshow (v1.51)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...nslideshow.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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •