Accordian: First element in the list triggering second eleme

I decided to redo my portfolio site, and wanted it to be a vertical scrolling page, with each list item on the left, scrolling to the assigned part on the right. That part was easy, the script already done, I just dropped it in, styled it, it worked. After much hacking and sawing and patching, I basically got it doing what I wanted it to do.

My current problem is, however, that I changed the nav to an accordion, with one section that opened to have a submenu. It was working fine up until I tried to put a nav element before the one with the submenu, because now the first nav button triggers the opening of the submenu, which is now the second element.

I’m not sure where exactly my problem lies, as I’m very limited on jQuery knowledge, and the code is very messy. But the problem itself is clearly visible if you look at the live copy:

Tips

What now? I have some ideas for you.

Go explore CodePen!

As a front end designer and developer, you should have an account on CodePen so you can save your snippets, present your ideas, and engage with the rest other front end folk. I'd encourage you to go PRO as well, to unlock the full power of CodePen.

Get the newsletter!

You should sign up for the CSS-Tricks newsletter. It's a clean copy of all the blog posts each week, combined together, right to your inbox. If email isn't your thing, there is an RSS feed, iTunes, and lots of other ways to subscribe.

Listen to ShopTalk!

Subscribe to The Lodge!

The Lodge is a members-only, ad-free video learning area here on CSS-Tricks. Just like the free screencasts, but organized into four large complete series. Membership is also the #1 best way to support CSS-Tricks.

We can do the real footer now.

Site Links

Colophon

CSS-Tricks* is created, written by, and maintained by Chris Coyier. It is built on WordPress, hosted by MediaTemple, and the assets are served by MaxCDN. The fonts are Source Sans and Source Code Pro. It is made possible by viewers like you who subscribe to The Lodge and through advertising for products and services I like.