Results 1 to 3 of 3

Thread: Cut & Paste JavaScript Slideshow - Random Starting Point?

  1. #1
    Join Date
    May 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Cut & Paste JavaScript Slideshow - Random Starting Point?

    This code is working beautifully, thank you!

    I would like to modify the code to randomly select just the starting point (I have over 40 image slides...).

    Could you advise me please?

    If this is possible that would be fantastic!

    Regards

    T John

  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

    We have no idea what script you're talking about. Do you mean:

    http://www.javascriptkit.com/script/.../jsslide.shtml

    If so, just add the highlighted:

    Code:
    //configure the paths of the images, plus corresponding target links
    slideshowimages("food1.jpg","food2.jpg","food3.jpg","food4.jpg","food5.jpg")
    slideshowlinks("http://food.epicurious.com/run/recipe/view?id=13285","http://food.epicurious.com/run/recipe/view?id=10092","http://food.epicurious.com/run/recipe/view?id=100975","http://food.epicurious.com/run/recipe/view?id=2876","http://food.epicurious.com/run/recipe/view?id=20010")
    
    //configure the speed of the slideshow, in miliseconds
    var slideshowspeed=2000
    
    var whichlink=0
    var whichimage=0
    whichimage = Math.floor(Math.random() * slideimages.length)
    function slideit(){
    if (!document.images)
    return
    document.images.slide.src=slideimages[whichimage].src
    whichlink=whichimage
    if (whichimage<slideimages.length-1)
    whichimage++
    else
    whichimage=0
    setTimeout("slideit()",slideshowspeed)
    }
    slideit()
    - John
    ________________________

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

  3. #3
    Join Date
    May 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    See, I knew you'd have an idea which script I was referring to!

    That's perfect!

    Thank you so much!

Similar Threads

  1. Stop slideshow from starting over
    By Ponder in forum Dynamic Drive scripts help
    Replies: 5
    Last Post: 05-26-2012, 03:23 PM
  2. Slideshow not always starting
    By lio in forum Dynamic Drive scripts help
    Replies: 31
    Last Post: 03-30-2010, 02:47 PM
  3. Replies: 3
    Last Post: 03-12-2009, 01:52 PM
  4. Slide Show - starting point
    By El Commodore in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 03-03-2006, 07:43 AM
  5. Replies: 0
    Last Post: 02-08-2005, 09:25 AM

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
  •