Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /home1/tylerfra/public_html/includes/common.inc).

JQuery Child Selector vs. Find

Category: 
Tags: 

So today I thought I knew enough about JQuery to easily add a click function to some unordered list menu items in a Drupal Panel... wrong.

Since Panels adds a bunch of its own divs inside the container div, this was not working:

$('div.my_panel > ul.menu > li').click(function () { alert('click'); } );

After a little experimenting, I realized the child selector doesn't work the way I thought. It is a "child" selector I guess, not a "grand child" selector. So instead I used the JQuery 'find' function.

This worked:

$('div.my_panel ').find('ul.menu > li').click(function () { alert('click'); } );

Lesson learned, I guess...