使用Zurb Foundation 5文档的充足代码:
<nav class="top-bar" data-topbar role="navigation">
<ul class="title-area">
<li class="name">
<h1><a href="#">My Site</a></h1>
</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">
<!-- 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>
<li class="active"><a href="#">Active 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>
我在控制台中收到以下错误:'未捕获的TypeError:无法读取属性'sticky_class'的undefined'
此外,当我在菜单中展开下拉菜单时,我收到此错误:'未捕获的TypeError:无法读取属性'dropdown_autoclose'的未定义'
我已经检查了foundation.toolbar.js文件,这两个似乎都设置在'settings'中:
settings : {
index : 0,
start_offset : 0,
sticky_class : 'sticky',
custom_back_text : true,
back_text : 'Back',
mobile_show_parent_link : true,
is_hover : true,
scrolltop : true, // jump to top when sticky nav menu toggle is clicked
sticky_on : 'all',
dropdown_autoclose: true
},
有人可以帮忙吗?