jCarousel

The jCarousel module provides the ability to create carousel-style lists such as those included on this page. The jCarousel module includes integrations with other Drupal modules, but may also be used manually within your own theme or custom modules. It does not include any site-wide settings page or options, each carousel is separately configured.

Views integration

Most configuration options for the jCarousel module are provided through Views module. You may configure a new view through the Views module interface. After adding a new view, change its "Display style" to "jCarousel" and configure the remaining options there. When using the jCarousel display style with Views, you can construct any of the examples on this page as well as dynamically loaded carousels through AJAX requests.

Custom implementations

The following are demonstrations of jCarousel module when used directly by another module or your theme. Most users do not need to manually code carousels (building carousels using Views is the most common approach), but these demonstrations provide good examples of jCarousel's abilities.

Horizontal carousel

This example uses jcarousel_add() directly with no options to create the default horizontal carousel.

Vertical carousel

jCarousel can accept a variety of configuration options via the second argument to jcarousel_add(). In this example, we created a vertical carousel.

Different skins

The "skin" of a carousel can be changed by setting the $options['skin'] property. This skin must match one of the skins either provided by a module or matching a skin included in your theme's style.css file. Skins are simply a class given to the HTML list with the name "jcarousel-skin-[skin-name]". A custom skin path may be specified in $options['skin path'], or you can use one of these module-based skins:

  • default
  • tango
Note that with skins you will often need to override certain CSS styles in your theme's style.css file. Certain properties (like the height and width of individual items and the carousel itself) must be manually specified directly in CSS. Not using a skin at all by specifying $options['skin'] = NULL and then styling the entire carousel in style.css is also a good approach.

Theme function

The theme('jcarousel') function allows you to easily create the markup and add all the JavaScript to the page in one function call. Like jcarousel_add() the theme function approach can also take options. In this example we create the carousel with the button next event being called when the mouse rolls over the buttons.

Circular wrap

This example puts the carousel into a circular wrap.