JQuery

Submitted by AppCreator on Tue, 03/13/2007 - 16:18

One of the many cool additions to Drupal 5 that I have only recently discovered is JQuery.

jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. jQuery is designed to change the way that you write JavaScript.

I managed to get cool little drop down menu working with just a couple of lines of code for a site I am developing.
$(document).ready(function() {
$('#topmenu_head LI > ul').hide();
$('#topmenu_head LI').mouseover(function() {
$('#topmenu_head LI > ul').hide();
$(this).find('> UL').show();
});
});

You target elements using the $() similar to the DOM's getElementById() and a combination of CSS selectors. There's really more to it then that but for now that's a pretty simple way to think of it. JQuery deserves more of a look.