简体   繁体   English

Foundation 5显示模式未打开

[英]Foundation 5 reveal modal does not open

I have been working with foundation 5, the reveal modal does not trigger and I'm totally at a loss. 我一直在使用Foundation 5,但显示模式不会触发,我完全不知所措。

Here's the modal code 这是模态代码

<td>
  <a href="#" data-reveal-id="modal">Delete</a>

  <div id="modal" class="reveal-modal medium" data-reveal>
      <p></p>
      <p>Please confirm</p>
      <a class="button radius">Confirm</a>
      <a class="close-reveal-modal">x</a>
  </div>
</td>

And the order of the scripts is in the right order just before closing the body tag. 在关闭body标签之前,脚本的顺序是正确的。

<script src="/js/vendor/modernizr.js"></script>
<script src="/js/vendor/jquery.js"></script>
<script src="/js/foundation.min.js"></script>
<script>
    $(document).foundation();
</script>

I have tried to wrap the $(document).foundation(); 我试图包装$(document).foundation(); in $(document).ready(function(){ , but nothing is happening. The alert boxes work just fine, so I'm baffled by the problem with reveal modals. $(document).ready(function(){ ,但是什么也没有发生。警报框可以正常工作,所以我对显示模式的问题感到困惑。

Any help would be appreciated. 任何帮助,将不胜感激。 Thanks. 谢谢。

The reason this happening, is perhaps because the modal should be the direct child of the "body" element. 发生这种情况的原因可能是因为模态应该是“身体”元素的直接子代。 It should not be part of the "td" element. 它不应该是“ td”元素的一部分。

I found the answer on this page: http://foundation.zurb.com/forum/posts/20051-foundation-5-reveal-modal-doesnt-open 我在此页面上找到了答案: http : //foundation.zurb.com/forum/posts/20051-foundation-5-reveal-modal-doesnt-open

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM