SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jun 2012
    Location
    New York
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile How to make jQuery Slider to stop after 1 cycle

    I'm using this basic jquery slider, but like it to stop after 1 cycle. I realized other sliders plugin have this option AFTER I've already incorporated this basic slider into my page, it works out great, except I need to have it stop after 1 cycle. Every slide is a list item, so I just need the automatic slide to stop at the last list item.

    This is what I have so far:

    jQuery(document).ready(function($) {

    $('#banner-slide').bjqs({

    // w + h to enforce consistency
    width : 660,
    height : 235,

    // transition valuess
    animtype : 'slide',
    animduration : 350, // length of transition
    animspeed : 10000, // delay between transitions
    automatic : true, // enable/disable automatic slide rotation

    // control and marker configuration
    showcontrols : false, // enable/disable next + previous UI elements
    centercontrols : false, // vertically center controls
    nexttext : 'Next', // text/html inside next UI element
    prevtext : 'Prev', // text/html inside previous UI element
    showmarkers : false, // enable/disable individual slide UI markers
    centermarkers : false, // horizontally center markers

    // interaction values
    keyboardnav : false, // enable/disable keyboard navigation
    hoverpause : false, // enable/disable pause slides on hover

    // presentational options
    usecaptions : false, // enable/disable captions using img title attribute
    randomstart : false, // start from a random slide
    responsive : false, // enable responsive behaviour

    loop:false
    });


    });

  2. #2
    SitePoint Member
    Join Date
    Jun 2012
    Location
    New York
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I forgot to include the link to the plugin: http://www.basic-slider.com/

  3. #3
    SitePoint Member
    Join Date
    Jun 2012
    Location
    New York
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe something like this: (not sure about the syntax)

    animationComplete: function() {
    if ($('.slideClass li:last').hasID('last-slide')) {
    stop();
    }
    }


Tags for this Thread

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
  •