基金会Zurb下拉不起作用

时间:2014-04-03 22:57:22

标签: jquery css html5 zurb-foundation

我刚下载了Foundation 5 CSS框架并复制了教程的代码,但下拉列表似乎没有用,以及" mobile"中的菜单。图。

我的代码:

<html>
<head>
   <link rel="stylesheet" href="css/foundation.css" />
   <script src="js/vendor/modernizr.js"></script>
   <script src="js/vendor/jquery.js"></script>
   <script src="js/foundation/foundation.js"></script>
   <script src="js/foundation/foundation.dropdown.js"></script>
   <script src="js/foundation/foundation.topbar.js"></script>
   <script> $(document).foundation(); </script>
</head>

<body>
<!-- header -->
<nav class="top-bar" data-topbar>
  <ul class="title-area">
    <li class="name">
      <h1><a href="#">My Site</a></h1>
    </li>
    <li class="toggle-topbar menu-icon"><a href="#">Menu</a></li>
  </ul>

  <section class="top-bar-section">
    <!-- Right Nav Section -->
    <ul class="right">
      <li class="active"><a href="#">Right Button Active</a></li>
      <li class="has-dropdown">
        <a href="#">Right Button Dropdown</a>
        <ul class="dropdown">
          <li><a href="#">First link in dropdown</a></li>
        </ul>
      </li>
    </ul>

    <!-- Left Nav Section -->
    <ul class="left">
      <li><a href="#">Left Nav Button</a></li>
    </ul>
  </section>
</nav>

</body>
</html>

任何人都知道它为什么不起作用?

1 个答案:

答案 0 :(得分:6)

尝试将以下代码从标题移动到正文中:

    <script>
        $(document).foundation();
    </script>