I know I can do this, I'm just getting lost in the hierarchy and need a second set of eyes on this.
Here's the structure 'm working with:
<div class="nav-column">
<ul>
<li><a href="#">Link 01</a>
<div>
<ul>
<li><a href="#">Sublink 01</a></li>
<li><a href="#">Sublink 02</a></li>
<li><a href="#">Sublink 03</a></li>
</ul>
</div>
</li>
<li><a href="#">Link 02</a></li>
<li><a href="#">Link 03</a></li>
</ul>
<div class="home"><h3>Underlying Div</h3></div>
</div>
I am looking to do the following: when you hover over a .nav-column ul li a that visibility of div.home would turn off. Of course there are going to be multiple .nav-columns so I'm making this dynamic.
The jQuery I have right now is:
if ($('.nav-column li').hasClass('active')){
$(this).parent('.nav-column').sibling('div.home').toggleClass("off");
}
without yielding any class addition to the div.home. I already have a hover function adding and removing the class '.active' to the .nav-column li
EDIT EDIT EDIT
I see that I have made a mistake with my code, and in fact the correct code has the div.home OUTSIDE the div.nav-column
This is the proper heirarchy:
<div class="wrapper">
<div class="nav-column">
<ul>
<li><a href="#">Link 01</a>
<div>
<ul>
<li><a href="#">Sublink 01</a></li>
<li><a href="#">Sublink 02</a></li>
<li><a href="#">Sublink 03</a></li>
</ul>
</div>
</li>
<li><a href="#">Link 02</a></li>
<li><a href="#">Link 03</a></li>
</ul>
</div>
<div class="home"><h3>Underlying Div</h3></div>
</div>
Once again... I am very sorry... you can sense my sanity levels dropping
div.homeis not a sibling of.nav-columnthough it's hard to see that as you haven't indented your code correctly