4

I want to use jQuery UI tooltip in my Drupal7 website.

I have installed 'jquery-update' and 'jquery-plugins' module and added

$(function() {
   $("a").tooltip();
});

in js file of my template. But firebug gives this error to me:

$(...).tooltip is not a function

that show the website doesn't find tooltip js file.

Should I do something more to use tooltip jquery ?

1
  • Can you show us how you added the JS file in your template? Commented Nov 19, 2013 at 21:40

1 Answer 1

6

Try adding:

drupal_add_library('system', 'ui.tooltip');

in your theme template.php file

/**
 * Implements hook_preprocess_html
 */
THEME_preprocess_html(&$variables){
  drupal_add_library('system', 'ui.tooltip');
}

That should ensure the library is available. You can add various conditions to make it page specific as required.

1
  • 1
    This implies that the jquery_update module shall be enabled
    – mchar
    Commented Jul 5, 2016 at 15:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.