JCarousel scroll method does not always fire

Posted by Scott Faisal on Stack Overflow See other posts from Stack Overflow or by Scott Faisal
Published on 2010-05-14T17:15:02Z Indexed on 2010/05/14 18:04 UTC
Read the original article Hit count: 305

Filed under:
|
|
var carousel = jQuery('#mycarousel').data('jcarousel');     
var index = carousel.size() + 1;
carousel.size(index); 
var html = '<li> some html </li>'; 
carousel.add(index, html);
carousel.scroll(index, 1);

The very last scroll method fires but not always. Is this a bug in JCarousel?

The following is the code for the scroll method in JCarousel:

/**
 * Scrolls the carousel to a certain position.
 *
 * @method scroll
 * @return undefined
 * @param i {Number} The index of the element to scoll to.
 * @param a {Boolean} Flag indicating whether to perform animation.
 */
scroll: function(i, a) {
    if (this.locked || this.animating)
        return;
    this.animate(this.pos(i), a);
}

© Stack Overflow or respective owner

Related posts about jcarousel

Related posts about JavaScript