You are here

function jquery_plugin_add in jQuery plugins 6

Same name and namespace in other branches
  1. 5 jquery_plugin.module \jquery_plugin_add()

Add a jQuery plugin to a page.

File

./jquery_plugin.module, line 6

Code

function jquery_plugin_add($plugin) {
  static $plugins = array(), $path;
  if (!isset($path)) {
    $path = drupal_get_path('module', 'jquery_plugin');
  }
  if (!isset($plugins[$plugin])) {
    drupal_add_js($path . '/jquery.' . $plugin . '.min.js');
    $plugins[$plugin] = TRUE;
  }
}