I have a header with 2 buttons : Login and Sign up Like this. When I click on one of them, a window appear : window open. For this I use the "Reveal Modal" of foundation (Reveal Modal).
My problem : If I click on link for open a new page of my website and try to open / close the Login or Sign up popup, the window is closed but this time the shadow stay (like this) and I need to press F5 for this works again.
I use Rails 4 and foundation 5.
File _header.html.erb (View Partial)
<div class="large-12 columns header">
<div class="logo">
logo
</div>
<div class="infos">
<ul>
<li><a href="#" class="" data-reveal-id="login">Login</a></li>
<li><a href="#" class="" data-reveal-id="signup">Sign up</a></li>
</ul>
</div>
</div>
<div id="login" class="reveal-modal" data-reveal>
<p>
Page Test
</p>
</div>
<div id="signup" class="reveal-modal roundish" data-reveal>
<p>
Page Test
</p>
</div>
File application.js
//= require jquery
//= require turbolinks
//= require foundation
//= require bxslider/jquery.bxslider.min.js
//= require home
//= require_tree .
$(function() {
$(document).foundation();
});
Thank you for your help.
This works for turbolinks progressbar and foundation tabs, accordion
//= require jquery
//= require jquery_ujs
//= require foundation
//= require turbolinks
//= require_tree .
var ready;
ready = function() {
$(document).foundation();
};
$(document).ready(ready);
$(document).on('page:load', ready);
The problem was Turbolinks.
Solution : Put //= require turbolinks
at the end
//= require jquery
//= require bxslider/jquery.bxslider.min.js
//= require foundation
//= require home
//= require_tree .
$(document).foundation();
//= require turbolinks
Thank You @AlexAube for your help ! :)
来源:https://stackoverflow.com/questions/25150922/trouble-using-foundation-and-turbolinks-with-rails-4