Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

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