简体   繁体   English

Foundation的顶部栏,切换按钮不起作用

[英]Foundation's top-bar, the toggle won't work

Following the instructions from here: 按照此处的说明进行操作:

The top bar has four main elements, three of which are needed for proper functionality: ul.title-area, a ul class="right/left element enclosed in a section class="top-bar-section", and the li.toggle-topbar element that will expand the menu in the mobile layout. You can leave out the li class="name" as long as you include the .toggle-topbar element. 顶部栏有四个主要元素,其中的三个元素是正常功能所必需的:ul.title-area,放在class class =“ top-bar-section”中的ul class =“ right / left元素”和li。 toggle-topbar元素,它将在移动布局中扩展菜单。只要包含.toggle-topbar元素,就可以省略li class =“ name”。

http://foundation.zurb.com/docs/components/top-bar.html http://foundation.zurb.com/docs/components/top-bar.html

I created this layout (this is the generated HTML that my wordpress theme loads): 我创建了这个布局(这是我的wordpress主题加载的生成的HTML):

<header id="masthead" class="site-header" role="banner">
  <nav id="site-navigation" class="navigation-main top-bar row" role="navigation">
    <ul class="title-area small-12 large-6 columns">
      <!-- Title Area -->
      <li class="name">
        <!--h1 class="menu-toggle"-->
        <h1>
          <img src="http://ns2101.boxqos.com/wp-content/uploads/2013/04/logo.png" id="logo_image" alt="Phoenix Concept" />
        </h1>
        <!-- 
<div class="screen-reader-text skip-link">
<a href="#content" title="Skip to content">
Skip to content
</a>
</div>
-->
            </li>
            <!-- Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone -->
            <li class="toggle-topbar menu-icon">
              <a href="#">
                <span>
                  Menu
                </span>
              </a>
            </li>
          </ul>
          <section class="top-bar-section small-12 large-6 columns">
            <ul id="menu-menu" class="left">
              <li id="menu-item-333" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-333">
                <a href="http://ns2101.boxqos.com/offnungszeiten/">
                  Öffnungszeiten
                </a>
              </li>
              <li id="menu-item-334" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-334">
                <a href="http://ns2101.boxqos.com/unser-restaurant/">
                  Unser Restaurant
                </a>
              </li>
              <li id="menu-item-335" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-335">
                <a href="http://ns2101.boxqos.com/willkommen/">
                  Willkommen
                </a>
              </li>
              <li id="menu-item-339" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-337 current_page_item menu-item-339">
                <a href="http://ns2101.boxqos.com/kontakt/">
                  kontakt
                </a>
              </li>
              <li id="menu-item-340" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-340">
                <a href="http://ns2101.boxqos.com/blog/">
                  Blog
                </a>
              </li>
            </ul>

            <script>
              $('.top-bar-section li').addClass('small-12 large-4');
              $('.top-bar-section').addClass('small-12 large-4');
            </script>
          </section>
  </nav>
  <!-- #site-navigation -->
</header>
<!-- #masthead -->

And I have included foundation's app: 而且我包括了基金会的应用程序:

$(function(){
        $(document).foundation(); 

})

The problems is that the toggle for the top navigation when the window resizes won't work.... 问题在于,当窗口调整大小时,顶部导航的切换将不起作用。

http://ns2101.boxqos.com/kontakt/# http://ns2101.boxqos.com/kontakt/#

Any idea what I'm misssing? 知道我想念什么吗?

Your issue is due to the toolbar script not loading. 您的问题是由于未加载工具栏脚本。 You either need to reference foundation.topbar.js or foundation.min.js and then make sure they are loaded . 您需要引用foundation.topbar.jsfoundation.min.js ,然后确保已加载它们 Use firebug in FF or the Dev. 在FF或Dev中使用firebug。 console in Chrome to see your site's issue with Foundation. Chrome中的控制台,以查看您的网站与Foundation的问题。

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

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