How do I collapse the div.collapse if I have the .click() trigger nested in another div (with the name div.click)?
I've got my script working if I have my .click() trigger in the same div as the div.collapse, this is my #main. Now I want to put my trigger in a div called 'click'. This is the structure I want to have:
<div id="main">
<div class="collapse" style="display:none;">
my content
</div>
<div class="click">
<a title="Click here to see the collapse div" alt="Expand" class="expand" href="javascript:void(0);">click here</a>
</div>
</div>
this is my jquery code so far, as I have no clue how to let it search one div back in the html structure:
$jq("a.expand").click(function()
{
// hides matched elements if shown, shows if hidden
$jq("a.expand").prev("div.collapse")[o.method](o.speed);
$jq("a.expand").prev("div.collapse").prev()[o.method](o.speed);
return false;
});
I hope someone can help me, thanks!