gpt4 book ai didi

javascript - Foundation 的顶栏,切换不起作用

转载 作者:行者123 更新时间:2023-11-28 20:31:17 26 4
gpt4 key购买 nike

按照此处的说明进行操作:

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.

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

我创建了这个布局(这是我的 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 -->

我已经包含了基金会的应用程序:

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

})

问题是当窗口大小调整时顶部导航的切换不起作用......

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

知道我错过了什么吗?

最佳答案

您的问题是由于工具栏脚本未加载造成的。您需要引用 foundation.topbar.jsfoundation.min.js,然后确保它们已加载。在FF或Dev中使用firebug。 Chrome 中的控制台可查看您网站的 Foundation 问题。

关于javascript - Foundation 的顶栏,切换不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16317248/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com