You are here

function theme_jcarousel in jCarousel 6

Same name and namespace in other branches
  1. 8.3 jcarousel.module \theme_jcarousel()
  2. 6.2 jcarousel.module \theme_jcarousel()
  3. 7.3 jcarousel.module \theme_jcarousel()
  4. 7.2 jcarousel.module \theme_jcarousel()

Creates a jCarousel element on the page.

Parameters

$items: The items to appear in the carousel.

$options: (optional) The arguments to apply to the selected element when creating the jCarousel. The arguments are passed through as an associative array using the jCarousel configuration options: http://sorgalla.com/projects/jcarousel/#Configuration

$skin: (optional) Either "tango", "ie7", or another name for your own skin. If you don't want to name your skin, use NULL. This skin name will be added as a class the the jCarousel element. Example: jcarousel-skin-NAME. Note that the skin will not be added if you do not pass a $selector.

$skin_path: (optional) If you're using a custom skin, this is where you pass the relative path to the skin's CSS file.

$id: (optional) The name of the jCarousel element.

1 theme call to theme_jcarousel()
jcarousel_help in ./jcarousel.module
Implementation of hook_help().

File

./jcarousel.module, line 186
Provides the jCarousel jQuery plugin.

Code

function theme_jcarousel($items = array(), $options = array(), $skin = 'tango', $skin_path = NULL, $id = 'jcarousel') {
  $name = form_clean_id($id);
  jcarousel_add('#' . $name, $options, $skin, $skin_path);
  $output = '<ul id="' . $name . '" class="js-hide jcarousel-skin-' . $skin . '">';
  foreach ($items as $item) {
    $output .= '<li>' . $item . '</li>';
  }
  $output .= '</ul>';
  return $output;
}