Results 1 to 10 of 10

Thread: Slide show: 1st a random image, then sequential order

  1. #1
    Join Date
    Nov 2008
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Slide show: 1st a random image, then sequential order

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

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...nslideshow.htm

    3) Describe problem:

    O.K. not really a problem... the script works great as is. Thanks to those who coded and posted it! This is more like a feature request that I don't know how to implement.

    As is the case with most slide shows, you are typically given the option for either RANDOM or SEQUENTIAL slide shows. What more could you want, right?

    But, what I would like is a tweak to the existing Ultimate Fade-in slideshow code for the option of: RANDOM image is selected, then the show proceeds in SEQUENTIAL order from that image to its next in the array.

    In other words, you wouldn't always be starting the sequence at the very beginning. In a particularly lengthy sequential sideshow, it would be nice to randomize the starting point yet still maintain the sequence of events.

    Unfortunately, I am not proficient enough in javascript to do it myself.
    I found a similar request, but was unsure how to implement the suggestion, here: http://www.actionscript.org/forums/a.../t-127278.html

    Any help is greatly appreciated.

  2. #2
    Join Date
    Nov 2008
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Random Start to Sequential Slide Show

    Is it possible to have a random starting point (not always the beginning) to a sequential slide show using the ultimate fade-in slide show???
    Last edited by heres2u; 11-06-2008 at 10:26 PM. Reason: clarification

  3. #3
    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

    It allows for either the order you set in the array(s), or for that order (for any given array or arrays) to be random. If you choose random, once the random order is set on load, it repeats identically for that array for that page load.
    - John
    ________________________

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

  4. #4
    Join Date
    Nov 2008
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    So the answer is NO? One cannot tweak the code to have the sequential slide show have a random starting point?

    There is another way I can do what I am trying to achieve but the overhead is not worth it. I could set up the random option using pre-designed animated gifs. The animated gifs maintain the sequence I want. The script set up with the random option gives me the random starting point that I want. Unfortunately, I'm afraid loading a series of 200kb animated images would be too much on page load or otherwise for those on slower connections.

    Thanks for replying!

  5. #5
    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

    Just about anything can be tweaked. My first answer was to gauge whether or not you knew what the script could do and/or if that would be sufficient. Apparently not, at least not on the second score. However, I really don't get it. Or if I do, I think it would be a bad idea, picture this:

    The slide show starts with a random image, it just happens to be the second image, so we get the second image twice in a row. Or we start with the third image, go to the second, then have the third again right away.

    What might be good, and what you might actually mean is to start at a random point in the array and go on from there.

    After rereading what you wrote, I think that is what you want. I've done mods like that before. I'm eating lunch though as I type this. I'll post a solution in a bit.
    Last edited by jscheuer1; 11-07-2008 at 06:39 PM.
    - John
    ________________________

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

  6. #6
    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

    OK, in the function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder) replace:

    Code:
    if (typeof displayorder!="undefined")
    theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
    this.theimages=theimages
    this.imageborder=parseInt(borderwidth)
    this.postimages=new Array() //preload images
    for (p=0;p<theimages.length;p++){
    with:

    Code:
    if (displayorder && displayorder == 'R')
    theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
    else if (displayorder && displayorder == 'Rs'){
    displayorder = Math.floor(Math.random() * theimages.length);
    theimages = theimages.slice(displayorder).concat(theimages.slice(0, displayorder));
    }
    this.theimages=theimages
    this.imageborder=parseInt(borderwidth)
    this.postimages=new Array() //preload images
    for (var p=0;p<theimages.length;p++){
    Now, in your on page call, you may still use the original syntax for for random or non - random order, but if you do:

    Code:
    new fadeshow(fadeimages2, 140, 225, 0, 3000, 0, "Rs")
    It will give you a random start point.
    - John
    ________________________

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

  7. The Following User Says Thank You to jscheuer1 For This Useful Post:

    heres2u (11-07-2008)

  8. #7
    Join Date
    Nov 2008
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    LOL. By all means, take lunch!

    Yes, what you stated, and what I actually mean, is to start at a random point in the (sequential) array and go on from there.

    The sequential slide shows I've seen and/or coded myself always start with the first image and proceed on from there. So whenever the user loads the web page it is always img 1,2,3,... They come back and hour later it is 1,2,3... A day later 1,2,3.

    What I would like is for the STARTING POINT of the sequence to be random... so, it may start at img 3, then go to img 4, 5, 6.... or start at img 6, then img 7, 8, 9, etc.

    I realize from your perspective you are asking, why not just use random setting then??? Because my images also contain text that only makes sense if kept in a sequential order. Then why not simply use sequential order??? Because my web statistics indicate an end user is never on the page long enough to ever view the images which come later in the sequence.

    I am trying to use the script more as a design element on a web page. Not necessarily a slide show in and of itself that would be viewed in its entirety in one sitting.

    Make sense?

  9. #8
    Join Date
    Nov 2008
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Thank You!

    I implemented the tweak and it is EXACTLY what I was envisioning! A random starting point to an otherwise sequential slide show!

    I am always amazed at others' abilities and gifts.

    Thanks for your time and effort jscheuer1!

  10. #9
    Join Date
    Mar 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Script Title: Ultimate Fade-in slideshow (v2.1)
    http://www.dynamicdrive.com/dynamici...nslideshow.htm

    I am looking for the exact same solution that is proposed in this thread. However, I noticed that the Ultimate Fade-in slideshow is a newer version than the one being discussed in this thread and I am unsure where to apply the changes as the code have changed.

    How would a random starting point to an the sequential slide show be coded in the 2.1 version? Any help is much appreciated!

    Many thanks!!!

  11. #10
    Join Date
    Mar 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ah, I found where I can randomize the starting point on page load by:
    displaymode: {type:'manual', pause:2500, cycles:0, wraparound:false, randomize:true}

    After implementing that, I see that the image and caption loads randomly on page load but the play order is not sequential in the order that it is listed in the array. Yes, the number (1/4, 2/4, etc) is sequential but image and caption is not.

    Any ideas? Thanks for your help!

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
  •