Menu icon Foundation
Off-canvas menu open by default

I have an off-canvas menu. I want it to remain open unless someone clicks the menu toggle. As it is now it is closed by default and closes whenever someone interacts with an element in the main content area.

off-canvas

I have an off-canvas menu. I want it to remain open unless someone clicks the menu toggle. As it is now it is closed by default and closes whenever someone interacts with an element in the main content area.

Jesus Lugo over 4 years ago

Hi Dan, you can set a JavaScript call to open menu on document load:

$('.off-canvas-wrap').foundation('offcanvas', 'show', 'move-right');
$('.off-canvas-wrap').foundation('offcanvas', 'hide', 'move-right');
$('.off-canvas-wrap').foundation('offcanvas', 'toggle', 'move-right');

Rafi Benkual over 4 years ago

That's really helpful Jesus. Here is a demo of that method. http://codepen.io/rafibomb/pen/emwBey
You'd want it to close after a few seconds like: http://zurb.com/building-blocks

Or use the overlap method and have the user dismiss it.

Benjamin Cavileer about 4 years ago

This isn't working for me.

Has this changed in version : '5.5.2' ?

Have these events been renamed?