V1 of this question can be found here: jQuery: menus appear/disappear on click
The difference with the first question is my HTML structure. Once I started implementing the megamenus with CSS, things weren't displaying the way I needed them to.
Here's the basic HTML:
<ul>
<li><span>Products & Services (1)</span></li>
<li><span>Support & Training (2)</span></li>
<li><span>Communities (3)</span></li>
<li><span>Store (4)</span></li>
</ul>
<div class="megamenu">1111</div>
<div class="megamenu">2222</div>
<div class="megamenu">3333</div>
<div class="megamenu">4444</div>
As with the first menu, this is what I need:
I need a way to have each link activate its own megamenu, and each megamenu should close when:
- The user clicks on another item in the nav bar.
- The user clicks on the same item in the nav bar.
- The user clicks on a 'close button' (X) graphic inside the megamenu (not shown in the HTML for simplicity sake).
I know this is very similar to how Tabs work, the difference is that each tab container can be closed/collapsed. Does that make sense?
Again, I'm not a jQuery/JS person (you can see that), so any help would be extremely appreciated.
Thanks,