Show parent element element
Let's say we have something like:
<div class="row">
<div class="box">
<a class="more" href="#more"/>
</div>
<div class="hidden">
stuff
</div>
</div>
<div class="row">
<div class="box">
<a class="more" href="#more"/>
</div>
<div class="hidden">
stuff
</div>
</div>
So when you press more link
it toggles
hidden class
. but not both hidden classes.
I tried to edit some things with help $(this)
but nothing.
Just started jquery / js so not the best with it.
This is what I have
$(".row .more").click(
function()
{
var parentTag = $(this);
var parentTag = "." + $(this).parent().parent().parent().attr('class') + "";
//$(this).prepend(document.createTextNode(parentTag));
$(parentTag + " .forum-stats").slideToggle("slow");
return false;
}
);
Now it works. :( I hope you understand my question ... Thanks!
+1
source to share