I am trying to make a simple accorion menu using jQuery together with Wordpress.
<script type="text/javascript" language="javascript">
var $j = jQuery.noConflict();
$j("#leftmenupane p.leftmenu_head").click(function(
{
$j(this).css({'background-image' : 'url(down.png)'}).next("div.leftmenu_body").slideToggle(300).siblings("div.leftmenu_body").slideUp("slow");
$j(this).siblings().css({'background-image' : 'url(left.png)'});
});
</script>
<div id="leftmenupane" class="leftmenu_list">
<p class="leftmenu_head">Header-1</p>
<div class="leftmenu_body">
<a href="#">Link-1</a>
<a href="#">Link-2</a>
<a href="#">Link-3</a>
<a href="#">Link-4</a>
</div>
<p class="leftmenu_head">Header-2</p>
<div class="leftmenu_body">
<a href="#">Link-1</a>
<a href="#">Link-2</a>
<a href="#">Link-3</a>
</div>
<p class="leftmenu_head">Header-3</p>
<div class="leftmenu_body">
<a href="#">Link-1</a>
</div>
</div>
It is actually a sample form some tutorial. But I cannot get it to work. I sense some stupid error here but I am unable to find it. All I get is a " missing: after property id" error in Firebug on line "$j(this).css({'background-image' : 'url(down. ... ".
Please help.