我正在尝试让Foundation Reveal Modal在我的rails应用程序中运行。我在基金会网站上关注了这个例子:
http://foundation.zurb.com/sites/docs/v/5.5.3/components/reveal.html
<a href="#" data-reveal-id="myModal">Click Me For A Modal</a>
<div id="myModal" class="reveal-modal" data-reveal aria-labelledby="modalTitle" aria-hidden="true" role="dialog">
<h2 id="modalTitle">Awesome. I have it.</h2>
<p class="lead">Your couch. It is mine.</p>
<p>I'm a cool paragraph that lives inside of an even cooler modal. Wins!</p>
<a class="close-reveal-modal" aria-label="Close">×</a>
</div>
点击按钮,没有任何反应。
js(不知道这是否正确......)
<script>
$('#myModal').foundation('reveal', 'open');
</script>
的application.js
//= require jquery
//= require jquery_ujs
//= require jquery.turbolinks
//= require turbolinks
//= require list
//= require foundation
//= require foundation-datepicker
//= require responsive-tables
//= require jquery.reveal
//= require list.fuzzysearch
//= require_tree .
我将揭示js和css文件下载到我的本地应用程序。我想这是我在这里绊倒的地方。有什么建议?感谢。
答案 0 :(得分:1)
您的代码看起来是正确的。您是否在页面底部打电话给基金会?
<script>
$(document).foundation();
</script>
您能指出我们网页的在线版本吗?