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

WordPress Building a WordPress Theme with Foundation 5

Ismar Uzeirovic
Ismar Uzeirovic
1,762 Points

Off-canvas menu not closing after click

Hi!

In Zac Gordon's Building a WordPress Theme with Foundation course we made an off-canvas menu.

the menu works fine but if you use browser's back button to return to the page the menu remains open.

Is it possible to close the menu after user clicks on a link?

Also, is it possible to make this menu fill the entire screen and slide from above?

Many thanks! This course was excellent!

1 Answer

Craig Watson
Craig Watson
27,930 Points

Hi Ismar :)

Sounds like you just need a little jQuery to run when the page is loaded. It is hard to have a peak at your code when working with wordpress but if you stick your js code up here I will have a look and see if we can trigger a click on that button when page loads :)

In regards to your other point about an overlay menu that would require a little more work but an interesting little project I think. I'm not sure how easy this may be especially given the complex nature of how WordPress structures its menus. Maybe try and spot a theme that has a collapsing menu from the side and modify it to stretch the full width :S it may be easier than starting from scratch on that one.

Craig