setup: function() {
Setups the carousel.
method setup
return undefined
reset: function() {
Clears the list and resets the carousel.
method reset
return undefined
reload: function() {
Reloads the carousel and adjusts positions.
method reload
return undefined
lock: function() {
Locks the carousel.
method lock
return undefined
unlock: function() {
Unlocks the carousel.
method unlock
return undefined
size: function(s) {
Sets the size of the carousel.
method size
return undefined
param s {Number} The size of the carousel.
has: function(i, i2) {
Checks whether a list element exists for the given index (or index range).
method get
return bool
param i {Number} The index of the (first) element.
param i2 {Number} The index of the last element.
get: function(i) {
Returns a jQuery object with list element for the given index.
method get
return jQuery
param i {Number} The index of the element.
add: function(i, s) {
Adds an element for the given index to the list. If the element already exists, it updates the inner html. Returns the created element as jQuery object.
method add
return jQuery
param i {Number} The index of the element.
param s {String} The innerHTML of the element.
remove: function(i) {
Removes an element for the given index from the list.
method remove
return undefined
param i {Number} The index of the element.
next: function() {
Moves the carousel forwards.
method next
return undefined
prev: function() {
Moves the carousel backwards.
method prev
return undefined
scrollTail: function(b) {
Scrolls the tail of the carousel.
method scrollTail
return undefined
param b {Boolean} Whether scroll the tail back or forward.
scroll: function(i, a) {
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.
pos: function(i, fv) {
Prepares the carousel and return the position for a certian index.
method pos
return {Number}
param i {Number} The index of the element to scoll to.
param fv {Boolean} Whether to force last item to be visible.
animate: function(p, a) {
Animates the carousel to a certain position.
method animate
return undefined
param p {Number} Position to scroll to.
param a {Boolean} Flag indicating whether to perform animation.
startAuto: function(s) {
Starts autoscrolling.
method auto
return undefined
param s {Number} Seconds to periodically autoscroll the content.
stopAuto: function() {
Stops autoscrolling.
method stopAuto
return undefined
pauseAuto: function() {
Pauses autoscrolling.
method pauseAuto
return undefined
buttons: function(n, p) {
Sets the states of the prev/next buttons.
method buttons
return undefined
notify: function(evt) {
Notify callback of a specified event.
method notify
return undefined
param evt {String} The event name
defaults: function(d) {
Gets/Sets the global default configuration properties.
method defaults
return {Object}
param d {Object} A set of key/value pairs to set as configuration properties.
$.fn.jcarousel = function(o) {
Creates a carousel for all matched elements.
example $("#mycarousel").jcarousel();
before <ul id="mycarousel" class="jcarousel-skin-name"><li>First item</li><li>Second item</li></ul>
result <div class="jcarousel-skin-name"> <div class="jcarousel-container"> <div class="jcarousel-clip"> <ul class="jcarousel-list"> <li class="jcarousel-item-1">First item</li> <li class="jcarousel-item-2">Second item</li> </ul> </div> <div disabled="disabled" class="jcarousel-prev jcarousel-prev-disabled"></div> <div class="jcarousel-next"></div> </div> </div>
method jcarousel
return jQuery
param o {Hash|String} A set of key/value pairs to set as configuration properties or a method name to call on a formerly created instance.