I have several instances of
(".wrappingdivclass > .hovercontents > .hovercontent2")
on a page.. all need to behave independently but call the same jquery. As you can see its two blocks of identical HTML...
how would I go up/down the dom tree to keep the hover/showhide on ONLY the stuff within the wrappingclass div, and not affect everything the next wrappingclass div also.
<div class="wrappingclass" id="notthesecondone">
<div class="hoverheaders">
<p class="hoverheading">on hover display stuff</p>
<p class="hoverheading1">on hover display stuff1</p>
<!-- iterate, as needed !-->
</div>
<div class="hovercontents">
<p class="hovercontent">stuff</p>
<p class="hovercontent1">stuff1</p>
<!-- iterate, as needed !-->
</div>
<div class="wrappingclass" id="notthefirstone">
<div class="hoverheaders">
<p class="hoverheading">on hover display stuff/hide stuff1</p>
<p class="hoverheading1">on hover display stuff1/hidestuff</p>
<!-- iterate, as needed !-->
</div>
<div class="hovercontents">
<p class="hovercontent">stuff</p>
<p class="hovercontent1">stuff1</p>
<!-- iterate, as needed !-->
</div>
Here is the jquery:
//does not work
jQuery(document).ready(function() {
jQuery(".hovercontent").show();
//toggle the componenet with class msg_body
jQuery(".hoverheading").hover(function()
{
jQuery(this).parent().children(".hovercontent").show()
jQuery(this).parent().children(".hovercontent").siblings().hide();
});
});