Drupal Behaviors

Drupal Theming + jQuery Basics (inc. Drupal Behaviors)

In this tutorial you'll see how to implement a toggling effect using jQuery within your Drupal theme whilst utilising Drupal behaviors.

The finished effect can be seen in this Drupal jQuery demo.

The toggle is achieved via a two-step process:

  • Step 1 - add content and markup to a node
  • Step 2 - implement jQuery, utilising Drupal behaviors, which will enable the toggling to work