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
Jaco Kotzee
Courses Plus Student 20,157 PointsI am struggling with my code: I have the first part correct, I get my navigation to show - but it doesn't hide.
I have the first part correct, I get my navigation to show - but it doesn't hide.
$(".main-nav").hide();
$(".menu-btn-container .menu-toggle").click(function() {
$(".main-nav").show();
$(".menu-btn-container").append("<a href='#' class='menu-toggle-off'><span class='menu-icon'><i class='fa fa-times'</i></span></a>");
$(this).remove();
});
$(".menu-btn-container .menu-toggle-off").click(function() {
$(".main-nav").hide();
});`
John Tasto
21,587 PointsI don't know if this is why, but
<i class='fa fa-times'
is missing the closing
>
.
Jaco Kotzee
Courses Plus Student 20,157 PointsJohn Tasto - No that doesn't resolve the problem :(
1 Answer
tomasvukasovic
24,022 PointsHave you tried using toggle instead of declaring hide in the last declaration?
Jaco Kotzee
Courses Plus Student 20,157 PointsJaco Kotzee
Courses Plus Student 20,157 PointsThe last part of my code doesnt work. I can't figure out why. Please help