Results 1 to 3 of 3

Thread: Up-Down Image Slideshow - can it be stopped after one iteration?

  1. #1
    Join Date
    Jun 2007
    Location
    Floyd, Virginia
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Up-Down Image Slideshow - can it be stopped after one iteration?

    1) Script Title: Up down slideshow Script

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

    3) Describe problem: I am using the Up-down Image Slide show on a weblog and want to stop the slideshow after one time through the list of images. The slideshow works very well, but is a distraction for someone wanting to read the next post.

    http://www.making-ripples.com/2007/0...day_after.html

    Is this possible?

    Thanks,

    David St Lawrence

  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

    First off, duplicate the last entry in your slide array and increase its number by 1, example (from the demo):

    Code:
    //configure the below variable to change the images used in the slideshow. If you wish the images to be clickable, simply wrap the images with the appropriate <a> tag
    var slideimages=new Array()
    slideimages[0]='<a href="http://www.cnn.com"><img src="PE01805A.gif" border="0"></a>'
    slideimages[1]='<img src="PE01803A.gif">'
    slideimages[2]='<img src="TN00411A.gif">'
    slideimages[3]='<img src="PE02054A.gif">'
    slideimages[4]='<img src="cake.gif">'
    slideimages[5]='<img src="cake.gif">'
    //extend this list
    Then replace the four move functions with these:

    Code:
    function move1(whichlayer){
    tlayer=eval(whichlayer)
    if (tlayer.top>0&&tlayer.top<=5){
    tlayer.top=0
    if(!startscroll.stop){
    setTimeout("move1(tlayer)",pausebetweenimages)
    setTimeout("move2(document.main.document.second)",pausebetweenimages)
    }
    return
    }
    if (tlayer.top>=tlayer.document.height*-1){
    tlayer.top-=5
    setTimeout("move1(tlayer)",50)
    }
    else{
    tlayer.top=parseInt(scrollerheight)
    tlayer.document.write(slideimages[i])
    tlayer.document.close()
    if (i==slideimages.length-1){
    i=0
    startscroll.stop=1
    }
    else
    i++
    }
    }
    
    function move2(whichlayer){
    tlayer2=eval(whichlayer)
    if (tlayer2.top>0&&tlayer2.top<=5){
    tlayer2.top=0
    if(!startscroll.stop){
    setTimeout("move2(tlayer2)",pausebetweenimages)
    setTimeout("move1(document.main.document.first)",pausebetweenimages)
    }
    return
    }
    if (tlayer2.top>=tlayer2.document.height*-1){
    tlayer2.top-=5
    setTimeout("move2(tlayer2)",50)
    }
    else{
    tlayer2.top=parseInt(scrollerheight)
    tlayer2.document.write(slideimages[i])
    tlayer2.document.close()
    if (i==slideimages.length-1){
    i=0
    startscroll.stop=1
    }
    else
    i++
    }
    }
    
    function move3(whichdiv){
    tdiv=eval(whichdiv)
    if (parseInt(tdiv.style.top)>0&&parseInt(tdiv.style.top)<=5){
    tdiv.style.top=0+"px"
    if(!startscroll.stop){
    setTimeout("move3(tdiv)",pausebetweenimages)
    setTimeout("move4(second2_obj)",pausebetweenimages)
    }
    return
    }
    if (parseInt(tdiv.style.top)>=tdiv.offsetHeight*-1){
    tdiv.style.top=parseInt(tdiv.style.top)-5+"px"
    setTimeout("move3(tdiv)",50)
    }
    else{
    tdiv.style.top=scrollerheight
    tdiv.innerHTML=slideimages[i]
    if (i==slideimages.length-1){
    i=0
    startscroll.stop=1
    }
    else
    i++
    }
    }
    
    function move4(whichdiv){
    tdiv2=eval(whichdiv)
    if (parseInt(tdiv2.style.top)>0&&parseInt(tdiv2.style.top)<=5){
    tdiv2.style.top=0+"px"
    if(!startscroll.stop){
    setTimeout("move4(tdiv2)",pausebetweenimages)
    setTimeout("move3(first2_obj)",pausebetweenimages)
    }
    return
    }
    if (parseInt(tdiv2.style.top)>=tdiv2.offsetHeight*-1){
    tdiv2.style.top=parseInt(tdiv2.style.top)-5+"px"
    setTimeout("move4(second2_obj)",50)
    }
    else{
    tdiv2.style.top=scrollerheight
    tdiv2.innerHTML=slideimages[i]
    if (i==slideimages.length-1){
    i=0
    startscroll.stop=1
    }
    else
    i++
    }
    }
    - John
    ________________________

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

  3. #3
    Join Date
    Jun 2007
    Location
    Floyd, Virginia
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Works like a charm!

    Thanks for the code changes.
    It makes a great difference in the presentation

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
  •