Menu icon Foundation
Keep fixed class with contain to grid on menu toggle

I noticed that when I click on the mobile menu it removes fixed from

<div class="contain-to-grid fixed"></div>
            

         

Is there any way to change it so it stays? Its in the js somewhere. I know a little js, but not enough to change this.

Thanks

fixedtopbarsticky

I noticed that when I click on the mobile menu it removes fixed from

<div class="contain-to-grid fixed"></div>
            

         

Is there any way to change it so it stays? Its in the js somewhere. I know a little js, but not enough to change this.

Thanks


Wing-Hou Chan gave the most helpful answer for this post
Wing-Hou Chan over 5 years ago

Hey James!

I attempted finding a fix in v5.1.1. Here is a demo: http://codepen.io/winghouchan/pen/kfxmD and these are the changes I made:

Remove topbar.removeClass('fixed'); throughout the whole of , there is only one on line 102.

Remove topbar.addClass('fixed'); throughout the whole of foundation.topbar.js, it is on line 103 and line 122.

However in v5.1.1, the Menu link doesn't toggle. Rafi, any ideas?

On the other hand, attempting a fix with the above changes in Topbar v5.0.3 (but still using v5.1.1 CSS and JS), the fix works. Here's a Pen for you to inspect: http://codepen.io/winghouchan/pen/GbxFl

Rafi Benkual over 5 years ago

Thats odd, can you post your code so we can test it out?

James Gehring over 5 years ago

Here is a pen http://cdpn.io/DleoC . I use firebug, but when you look at the code with the fixed element and click the menu, it toggles open and removes the fixed from my first div and adds it to the nav.

Wing-Hou Chan over 5 years ago

Hey James!

I attempted finding a fix in v5.1.1. Here is a demo: http://codepen.io/winghouchan/pen/kfxmD and these are the changes I made:

Remove topbar.removeClass('fixed'); throughout the whole of , there is only one on line 102.

Remove topbar.addClass('fixed'); throughout the whole of foundation.topbar.js, it is on line 103 and line 122.

However in v5.1.1, the Menu link doesn't toggle. Rafi, any ideas?

On the other hand, attempting a fix with the above changes in Topbar v5.0.3 (but still using v5.1.1 CSS and JS), the fix works. Here's a Pen for you to inspect: http://codepen.io/winghouchan/pen/GbxFl

James Gehring over 5 years ago

Thanks @Wing-Hu Chan, pointed me in the right direction.

Rafi Benkual over 2 years ago

Good news! Thanks to your feedback there was a push to build something better. In Foundation 6.3, released on Dec 15th, there is an all new improved off-canvas. We’d love to hear the challenges or common patterns with off-canvas are you working with. Check out the details and jump in on the conversation!

 

http://foundation.zurb.com/forum/posts/49868-new-improved-off-canvas-in-foundation-63