Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Sep 2007
    Location
    NY
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Stopping a rotating image script from looping

    Hi,

    ***PLEASE NOTE THAT I REPOSTED THIS IN THE JQUERY FORUM AT THE RECOMMENDATION OF ONE OF THE SENIOR MEMBERS OF THIS FORUM**

    I am working with a template I purchased that will loop a series of header images. I like to stop the image series from going back to the beginning once the series of images cycles through.

    For instance, if there were 3 images in the sequence; currently the script cycles through all 3 images and then starts from the beginning. I would like the script to stop on the last image (so that image stays displayed) and not start the sequence again from the beginning. I couldn't get any support for hacking this script from the developers.

    Here is the relevant code:


    Code:
    	<script type='text/javascript'>
    		/* <![CDATA[ */
    			jQuery(document).ready(
    				function() {
    					jQuery('#featured-images-rotator').crossSlide(
    						{sleep: <?php echo $this->_options['sleep']; ?>, fade: <?php echo $this->_options['fade']; ?><?php echo $target; ?>},
    						[
    							<?php echo "$list\n"; ?>
    						]
    					);
    				}
    			);
    		/* ]]> */
    	</script>

    I am attaching the original file where this snippet of code was extracted from.

    Thanks for looking at this.
    Attached Files Attached Files

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,927
    Thanks
    6
    Thanked 1,041 Times in 1,014 Posts
    I just looked at the crossSlide website, and look what I found:
    Quote Originally Posted by http://www.gruppo4.com/~tobia/cross-slide.shtml

    You can have the animation loop just once, or a fixed number of times, by adding a loop option to the first parameter, alongside fade, sleep or speed.

  • #3
    New Coder
    Join Date
    Sep 2007
    Location
    NY
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That was great, thanks for pointing that out. I looked it over but do not know how to edit that code to get the images to go through the sequence and stop. Can you kindly provide and example?

    Thanks

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,927
    Thanks
    6
    Thanked 1,041 Times in 1,014 Posts
    This line:
    Code:
    {sleep: <?php echo $this->_options['sleep']; ?>, fade: <?php echo $this->_options['fade']; ?><?php echo $target; ?>},
    add loop: 1 somewhere in there (I suppose loop goes with a number for the times to loop through), like so:
    Code:
    {loop: 1, sleep: <?php echo $this->_options['sleep']; ?>, fade: <?php echo $this->_options['fade']; ?><?php echo $target; ?>},

  • #5
    New Coder
    Join Date
    Sep 2007
    Location
    NY
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Solved and a big thank you

    Well that did it and I am really appreciative of the assistance. Thanks for making my life a whole lot easier. I will post this solution in the developers forum so that someone else will benefit from this as well.

    Thanks again


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •