Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Can anyone help with this code?

I have created Navigation with submenus, I was wondering how to keep the 'submenus' open when the active page is clicked

 function initMenu() {
   $('#menu ul').hide(); 
   $('#menu li a').click(

   function() {
     $(this).next().slideToggle('normal')

   });

 }
 $(document).ready(function() {initMenu();});

6 Answers

That's an impressive title over 30 words, and not a single word in the body of the post, that is apart from a block of code you want someone to fix for you.

like I said James I'm new to this so forgive my ignorance :(

@Paul - Much improved :+1:

The only thing I would add, is the JQuery tag to the forum post.

thanks James :) I think I found a way to fix this :)

again clearly a newbie here

@Paul - Glad to help.

Alas, I'm not great with JQuery so, someone else will have to help the content of your post.

@James - Thanks for your help :)