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 4 of 4
  1. #1
    Regular Coder StealthRT's Avatar
    Join Date
    Aug 2006
    Posts
    188
    Thanks
    14
    Thanked 0 Times in 0 Posts

    Question jQuery Jcarousel automatically scroll circular items

    Hey all i need help modifying my code below in order to have my carousel automatically continue when it reaches the end. The code works just fine as-is but it goes back to the first image after it ends... I do not really want that, i just want it to continue without going back.

    Code:
    function mycarousel_initCallback(carousel)
    {
            carousel.clip.hover(function() {
                    carousel.stopAuto();
            }, function() {
                    carousel.startAuto();
            });
    };
     
    jQuery(document).ready(function() {
         jQuery('#mycarousel').jcarousel({
                    auto: 3,
                    //wrap: 'circular',
                    wrap: 'last',
                    initCallback: mycarousel_initCallback
            });
    );
    ex:

    image1 -> image2 -> image3 -> image4 -> image1 -> image2...

    INSTEAD OF DOING THIS:
    image1 -> image2 -> image3 -> image4 -> loops back to image1 <-

    I do not know how to add both "last" and "circular" to the wrap properties.

    The website is here for the jCarousel: http://sorgalla.com/jcarousel/

    Any help would be great!

    David

  • #2
    Regular Coder Iszak's Avatar
    Join Date
    Jun 2007
    Location
    Perth, Western Australia
    Posts
    332
    Thanks
    2
    Thanked 58 Times in 57 Posts
    I'm not entirely sure what's the problem - I understand you don't want it to scroll back to the first image, you want it to keep rotating around, so after the last one you have the first one again. Well you've just got to set
    Code:
    jQuery(document).ready(function() {
         jQuery('#mycarousel').jcarousel({
                    auto: 3,
                    wrap: 'circular',
                    initCallback: mycarousel_initCallback
            });
    );
    There's no need for wrap: 'last', or is there something else?

  • #3
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Scrolling

    Hello

    I'm having the same problem....

    We when i've entered wrap: 'circular', it moves off screen and does not wrap.

    current URL is http://www.keanechan.com

    Any help most grateful
    Keane

  • #4
    New to the CF scene
    Join Date
    Oct 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Add an event listener

    Hey all,

    The problem is, even though wrap is set to circular, jCarousel turns off the automatic scrolling when it hits the end of the line. All you need to do is add an event listener that checks if the carousel is stopped and turn it back on.

    You can get the code from my site.

    Regards,
    Aaron


  •  

    Posting Permissions

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