See also
Scrolls to a specific item or relative by a given offset (See section Available formats for the target argument for more information about the target argument).
If the argument animate is given and false, it just jumps to the position without animation.
If the argument callback is given and a valid function, it is called after the animation is finished.
The function receives as first argument a boolean indicating if a scrolling actually happend.
It can be false for the following reasons:
Example:
$('.jcarousel').jcarousel('scroll', '+=1', true, function(scrolled) {
if (scrolled) {
console.log('The carousel has been scrolled');
} else {
console.log('The carousel has not been scrolled');
}
});
Reloads the carousel. This method is useful to reinitialize the carousel if you have changed the content of the list from the outside or want to change options that affect appearance of the carousel at runtime.
Example:
$('.jcarousel').jcarousel('reload', {
'animation': 'slow'
});
Removes the jCarousel functionality completely. This will return the element back to its initial state.
Example:
$('.jcarousel').jcarousel('destroy');
Returns the list element as jQuery object.
Example:
var list = $('.jcarousel').jcarousel('list');
Note
Please note that the item-related methods return different results depending on the state of the carousel. That means for example, that after each scroll, these methods return a different set of items.
The following example illustrates how to use these methods inside event callbacks:
$('.jcarousel')
.on('animateend.jcarousel', function(event, carousel) {
var currentFirstItem = carousel.jcarousel('first');
var currentLastItem = carousel.jcarousel('last');
});
Returns all items as jQuery object.
Example:
var items = $('.jcarousel').jcarousel('items');
Returns the targeted item as jQuery object.
Example:
var target = $('.jcarousel').jcarousel('target');
Returns the first visible item as jQuery object.
Example:
var first = $('.jcarousel').jcarousel('first');
Returns the last visible item as jQuery object.
Example:
var last = $('.jcarousel').jcarousel('last');
Returns all visible items as jQuery object.
Example:
var visible = $('.jcarousel').jcarousel('visible');
Returns all fully visible items as jQuery object.
Example:
var fullyvisible = $('.jcarousel').jcarousel('fullyvisible');
Enter search terms or a module, class or function name.