foundation 5 reveal modal not working

时光总嘲笑我的痴心妄想 提交于 2019-12-05 02:04:00

问题


Good day to all,

I'm using foundation 5 for my mini project. I want to use the reveal/modal feature of the framework. But it seems it does not work.

index.html

<!DOCTYPE html>
<html>
<head>
    <title>Job Posting</title>
    <link rel="stylesheet" type="text/css" href="../css/normalize.css">
    <link rel="stylesheet" type="text/css" href="../css/foundation.min.css">

    <script type="text/javascript" src="../js/vendor/custom.modernizr.js"></script>
</head>
<body>
  <a href="#" class="button" data-reveal-id="myNormal">click</a>
  <div class="reveal-modal" id="myNormal">
      Modal
      <a class="close-reveal-modal">x</a>
  </div>
   <script src="../js/vendor/jquery.js"></script>
   <script src="../js/foundation/foundation.js"></script>
   <script src="../js/foundation/foundation.reveal.js"></script>
   <script>
      $(document).foundation();
   </script>
</body>

I'm pretty sure that the browser loaded the js as it does not show any error in the debugger. And I know it's somewhere in the code that I left out but it's been a couple of hours since I ran into this. Any help would be much appreciated.


回答1:


You might have forgot data-reveal :

<div class="reveal-modal" id="myNormal" data-reveal>


来源:https://stackoverflow.com/questions/20260814/foundation-5-reveal-modal-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!