Results 1 to 2 of 2

Thread: conveyor belt script - how can I make it stop?

  1. #1
    Join Date
    Mar 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question conveyor belt script - how can I make it stop?

    1) Conveyor Belt Script:

    2) http://www.dynamicdrive.com/dynamici...rightslide.htm

    3) Describe problem:

    No basic issue getting the script up and running (www.garden-cgc.org); however, I've been asked whether or not there is a way to program the script to stop running after the slideshow runs a few times.

    Is it possible to get it to run through once or twice and make it stop from there?

    Thanks!
    Jess
    Last edited by jscheuer1; 03-04-2009 at 04:51 AM. Reason: fix link

  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

    Replace the existing slideleft function with this one (additions highlighted):

    Code:
    function slideleft(){
    if (iedom){
    if (slideleft.count == 0){
    clearInterval(lefttime);
    return;
    }
    if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+8))
    cross_slide.style.left=parseInt(cross_slide.style.left)-copyspeed+"px"
    else{
    slideleft.count = ++slideleft.count || 0;
    cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth+slideshowgap+"px"
    }
    if (parseInt(cross_slide2.style.left)>(actualwidth*(-1)+8))
    cross_slide2.style.left=parseInt(cross_slide2.style.left)-copyspeed+"px"
    else{
    slideleft.count = ++slideleft.count || 0;
    cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+slideshowgap+"px"
    }
    }
    else if (document.layers){
    if (ns_slide.left>(actualwidth*(-1)+8))
    ns_slide.left-=copyspeed
    else
    ns_slide.left=ns_slide2.left+actualwidth+slideshowgap
    
    if (ns_slide2.left>(actualwidth*(-1)+8))
    ns_slide2.left-=copyspeed
    else
    ns_slide2.left=ns_slide.left+actualwidth+slideshowgap
    }
    }
    The red 0 controls how many times the contents will pass by, 0 is once only, 1 would be twice, and so on.
    - 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
  •