问题描述
我有一个带有2个按钮的标题:登录并注册。
当我点击其中一个时,会出现一个窗口:。为此,我使用基础的显示模式()。
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).
我的问题:如果我点击链接打开我的网站的新页面并尝试打开/关闭登录或注册弹出窗口,则窗口关闭,但这次阴影停留(),我需要再次按F5进行此操作。
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.
我使用Rails 4和基础5。
I use Rails 4 and foundation 5.
文件_header.html.erb(查看部分)
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>
文件application.js
File application.js
//= require jquery
//= require turbolinks
//= require foundation
//= require bxslider/jquery.bxslider.min.js
//= require home
//= require_tree .
$(function() {
$(document).foundation();
});
感谢您的帮助。
推荐答案
问题是Turbolinks。
The problem was Turbolinks.
解决方案:输入 // =需要turbolinks
最后
//= require jquery
//= require bxslider/jquery.bxslider.min.js
//= require foundation
//= require home
//= require_tree .
$(document).foundation();
//= require turbolinks
感谢@AlexAube的帮助! :)
Thank You @AlexAube for your help ! :)
这篇关于使用基础和Turbolinks与Rails 4的麻烦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!