Jquery Accordion & Wordpress

admin

Administrator
Staff member
am trying to use the <a href="http://docs.jquery.com/UI/Accordion#options" rel="nofollow noreferrer">Jquery accordion</a> to show a list of links generated by wordpress with the <a href="http://codex.wordpress.org/Template_Tags/wp_list_categories" rel="nofollow noreferrer">
Code:
wp_list_categories();
</a> function.

This function returns a list of
Code:
&lt;ul&gt;
Code:
&lt;li&gt;
Code:
&lt;a&gt;
tags. My problem is that in order to get it working fine, like the second exemple on <a href="http://jquery.bassistance.de/accordion/demo/" rel="nofollow noreferrer">this page</a>, the heading
Code:
&lt;a&gt;
tags, have to get a special class:
Code:
&lt;a class="head" href="?p=1.1.1"&gt;Guitar&lt;/a&gt;
that is used in the js definition of the accordion:

Code:
jQuery('#navigation').accordion({
        active: false,
        autoheight:false,
        header: '.head',
        event: 'mouseover'
    });

Without this class, the hover opens the sub list, but as soon as i get down to hover on of the child elements, it closes the accordion. The exemple is the grey bloc on <a href="http://soulbrasileiro.com.br/site/" rel="nofollow noreferrer">this page</a>.

My question goes like this, is it possible to append with javascript the required class (.head for ex) to this dynamically generated list ?