You are here

function jcarousel_init in jCarousel 7.3

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

Implementation of hook_init().

File

./jcarousel.module, line 36
Provides integration with 3rd party modules and the jCarousel library.

Code

function jcarousel_init() {

  // Global JS settings required for all carousels.
  drupal_add_js(array(
    'jcarousel' => array(
      'ajaxPath' => url('jcarousel/ajax/views'),
    ),
  ), 'setting');

  // Load the jcarousel library via Libraries API.
  $library = libraries_load('jcarousel');
  drupal_add_js(drupal_get_path('module', 'jcarousel') . '/js/jcarousel.js');

  // Load the default jCarousel stylesheet.
  drupal_add_css(drupal_get_path('module', 'jcarousel') . '/css/jcarousel.css');
}