javascript - Zurb Foundation 5 + Rails 4 : toggle-topbar won't work -


i have tried in knowledge (however little there is), can not make top bar menu render on small screens. want menu reduce down clickable menu item on small screens, responsive behaviour menu. apparently following code alone should make work, doesn't.

<header>       <div class="row">         <div class="large-12 large-centered small-12 small-centered columns">           <nav class="top-bar" data-topbar role="navigation">             <section class="top-bar-section">                 <ul class="title-area">                   <li class="toggle-topbar menu-icon"><a href="#"><span></span></a></li>                 </ul>                 <ul class="left">                   <li><%= link_to('link', {:controller => 'controller', :action => 'action'}) %></li>                   <!-- other links -->                     </ul>                 <ul class="right">                     <li><%= link_to('link', {:controller => 'controller', :action => 'action'}) %></li>                     <!-- other links -->                 </ul>               </section>           </nav>             </div>     </div> </header> 

i think has javascript related foundation i'm not sure exactly.

edit:

application.js :

// //= require jquery //= require foundation //= require jquery_ujs //= require turbolinks //= require_tree .   $(document).ready(function() {     $(document).foundation(); }); 

application.scss

/*  *  *= require_tree .  *= require_self  *= require foundation_and_overrides   */  @import 'custom'; 

the custom.scss file imports foundation_and_overrides.scss .

besides suggestion below, make sure change href in

<ul class="title-area">      <li class="toggle-topbar menu-icon"><a href="#"><span></span></a></li> </ul> 

to href="" .

i've copied last comment http://foundation.zurb.com/forum/posts/2348-foundation-5-topbar-menu-not-responding-on-rails4

you need add

gem 'jquery-turbolinks'

to gem file usual bundle install

following change javascript manifest file (application.js) run in following order:

//= require jquery //= require jquery.turbolinks //= require jquery_ujs //= require foundation //= require_tree . $(function(){ $(document).foundation({}); // other code etc //= require turbolinks 

this ensure turbolinks runs after else (especially foundation in case).


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -