This page is archived
We're keeping this page up as a courtesy to folks who may need to refer to old instructions. We don't plan to update this page.
In this exercise you will demonstrate your ability to attach JavaScript to themes, and use Drupal behaviors to enhance the functionality of a website.
Goal
Create a tooltip for the Top Ten Lists view using jQuery.
Prerequisites
You will need the following knowledge and skills. If you need a review, check out the Additional resources section at the bottom of this page.
- Create and attach JavaScript files.
- Understand how behaviors are used within Drupal.
- Write jQuery to enhance the functionality of a website.
Wireframe reference
You will need to refer to the wireframe collection PDF.
- Homepage
Tasks
Create a tooltip for the homepage Top Ten Lists view as per the requirements details on the wireframes.
Recap
- JavaScript can be attached to the theme, a render array, or injected at runtime.
- Drupal behaviors allow for a more efficient use of JavaScript, and allow different parts of Drupal to interact.
Further your understanding
- Continue to the next lesson: Movie Project: Use Responsive CSS.
Additional resources
- Managing JavaScript in Drupal 7 (Drupal.org)
- jQuery Learning Center (jQuery.com)