You are here

function jcarousel_add in jCarousel 5

Same name and namespace in other branches
  1. 8.5 jcarousel.module \jcarousel_add()
  2. 8.3 jcarousel.module \jcarousel_add()
  3. 8.4 jcarousel.module \jcarousel_add()
  4. 6.2 jcarousel.module \jcarousel_add()
  5. 6 jcarousel.module \jcarousel_add()
  6. 7.2 jcarousel.module \jcarousel_add()

Add the JS and basic CSS to the current page, if they aren't added already.

File

./jcarousel.module, line 12
This module provides a central function for adding the jCarousel jQuery plugin and makes sure it's added only once per page.

Code

function jcarousel_add() {
  static $added;
  if (!isset($added)) {
    drupal_add_js(drupal_get_path('module', 'jcarousel') . '/jcarousel.js');
    drupal_add_css(drupal_get_path('module', 'jcarousel') . '/jcarousel.css');
    $added = TRUE;
  }
}