Results 1 to 3 of 3

Thread: Presentational Slideshow Script - random view

  1. #1
    Join Date
    May 2005
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Presentational Slideshow Script - random view

    1) Script Title: Presentational Slideshow Script

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

    3) Describe problem: How can I make the images appear in "random" order so that the user sees different ones every time? Thanks so much!

  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

    Add the highlighted as shown:

    Code:
    //Presentational Slideshow Script- By Dynamic Drive
    //For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
    //This credit MUST stay intact for legal use
    
    var slideshow_width='100px' //SET SLIDESHOW WIDTH (set to largest image's width if multiple dimensions exist)
    var slideshow_height='100px' //SET SLIDESHOW HEIGHT (set to largest image's height if multiple dimensions exist)
    var pause=3000 //SET PAUSE BETWEEN SLIDE (2000=2 seconds)
    var slidebgcolor="white"
    
    var dropimages=new Array()
    //SET IMAGE PATHS. Extend or contract array as needed
    dropimages[0]="image1.gif"
    dropimages[1]="image2.gif"
    dropimages[2]="image3.gif"
    
    var droplinks=new Array()
    //SET IMAGE URLs. Use "" if you wish particular image to NOT be linked:
    droplinks[0]="http://www.yahoo.com"
    droplinks[1]=""
    droplinks[2]="http://www.google.com"
    
    ;(function(){
    	var randar = [], i = dropimages.length;
    	while(--i > -1){
    		randar[i] = [dropimages[i], droplinks[i]];
    	}
    	randar.sort(function(){return 0.5 - Math.random();});
    	i = dropimages.length;
    	while(--i > -1){
    		dropimages[i] = randar[i][0];
    		droplinks[i] = randar[i][1];
    	}
    })();
    ////NO need to edit beyond here/////////////
    
    var preloadedimages=new Array()
    for (p=0;p<dropimages.le
    - John
    ________________________

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

  3. #3
    Join Date
    May 2005
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you John! You guys are so wonderful on this site! I truly appreciate all your help! Have a great day

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
  •