When I click a node in a drupal view it toggles the body for every node in my view instead of just the node I am clicking. How can I get jquery to toggle just the node I am clicking? Here is my code in the head of my node template (node-type.tpl.php)
<script>
$("button").click(function () {
$(".more").toggle();
});
</script>
And the code for the body to be toggled.
<div class="more"><?php print $node->content['body']['#value']; ?></div>
Currently it toggles every div with the class "more" in my entire view instead of just in the node which I am clicking. How do I restrict it to just the clicked node?
I would also like it if only body were open at a time. ie; when a different node is clicked, the previous node's body toggles closed.
I'm sure it's probably easy but I just can't seem to figure it out...