0

我似乎无法开始工作,我已经按照信函进行了所有操作,添加了modernizr,添加了插件,添加了css(显然包含在基础中),在开始时初始化了基础并加载了jquery底部。我错过了什么?

<html>
    <head>
    <script src="js/custom.modernizr.js"></script>
    <script src="js/foundation.min.js"></script>



        <link rel="stylesheet" href="css/foundation.css">
      <link rel="stylesheet" href="css/foundation.min.css">
      <link rel="stylesheet" href="css/normalize.css">

    <script>
      $(function(){
        $(document).foundation();    
      })
    </script>

    </head>
    <body>
    <div id="myModal" class="reveal-modal">
      <h2>Awesome. I have it.</h2>
      <p class="lead">Your couch.  It is mine.</p>
      <p>Im a cool paragraph that lives isnside of an even cooler modal. Wins</p>
      <a class="close-reveal-modal">&#215;</a>
    </div>

            <a href="#" class="big-link" data-reveal-id="myModal" id="my-trigger">
                Fade and Pop
            </a>    

    </body>

    <script>
      document.write('<script src=/js/vendor/'
        + ('__proto__' in {} ? 'zepto' : 'jquery')
        + '.js><\/script>');
    </script>

    </html>

触发模态 $('#my-trigger').trigger('click'); 就像那里一样:在 Foundation 4 中显示模态也没有帮助。

4

1 回答 1

1

在我的构建中,javascript 在页脚之后(modernizr 除外)。我创建了一个与您的设置类似的测试页面,以尝试重新创建问题。尝试移动

<script src="js/foundation.min.js"></script>

<script>
  $(function(){
    $(document).foundation();    
  })
</script>

就在你之后

<script>
  document.write('<script src=/js/vendor/'
    + ('__proto__' in {} ? 'zepto' : 'jquery')
    + '.js><\/script>');
</script>
于 2013-05-06T20:12:10.113 回答