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
Paul Johnston
1,292 PointsCan 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
James Barnett
39,199 PointsThat'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.
Paul Johnston
1,292 Pointslike I said James I'm new to this so forgive my ignorance :(
James Barnett
39,199 Points@Paul - Much improved
The only thing I would add, is the JQuery tag to the forum post.
Paul Johnston
1,292 Pointsthanks James :) I think I found a way to fix this :)
again clearly a newbie here
James Barnett
39,199 Points@Paul - Glad to help.
Alas, I'm not great with JQuery so, someone else will have to help the content of your post.
Paul Johnston
1,292 Points@James - Thanks for your help :)