13. Add to Drupal
‣ Enclose the commands in “ready” function
$(document).ready(
function() {
$(‘p’).hide(‘slow’);
});
13
14. Add to Drupal
‣ Save in a file in /yourtheme/scripts/file.js
‣ In template.php:
drupal_add_js(path_to_theme().‘file.js’, ‘theme’, ‘header’);
‣ (Optional) Use logic to specify when to call
otherwise it will be called on all pages.
‣ jQuery loaded automatically when you use
drupal_add_js().
14
15. Resources
‣ http://docs.jquery.com
drupal_add_js API Reference
‣
‣ http://learningjquery.com
‣ Hacking Digg.com with Firebug
15