我正在尝试在Zurb fdn6模板的cli安装中使用Magellan。该网页运行良好,但麦哲伦只是不为粘性导航工作,并抛出以下控制台错误:
Uncaught TypeError: Cannot read property 'top' of undefined
Foundation 6 Magellan sticky不能与Zurb模板一起工作cli install
这样看来麦哲伦注册因为DevTools查看源代码时,我可以看到data-sticky
attr注册一个值,当向上/向下滚动时,类将被应用于锚点。
但是,我注意到类不是注册是:is-at-top is-stuck
这些似乎是什么让事情'棒'。它们出现在Zurb文档示例中。
在app.js
我有$(document).foundation();
当页面运行时,我可以看到Magellan模块实际上正在加载。但粘性导航只是不坚持到窗口的顶部,它只是不能在这个设置。
<div data-sticky-container>
<div class="sticky" id="example" data-sticky data-margin-top="0" style="width:100%;" data-margin-bottom="0" data-top-anchor="topAnchorExample" data-btm-anchor="bottomOfContentId:bottom">
<nav data-magellan>
<ul class="horizontal menu expanded">
<li><a href="#first">First Arrival</a></li>
<li><a href="#second">Second Arrival</a></li>
<li><a href="#third">Third Arrival</a></li>
</ul>
</nav>
</div>
</div>
以下标准例如我已经看到其他SO实例固定的,但它们似乎都使用除Zurb tempate构建其他一般加载经由标准<script src="xyz">
呼叫的插件。
有人知道这个Zurb模板的例子吗?
对不起,延迟回复。我明白你的意思,但它仍然不适合我!我得到完全相同的结果 - 麦哲伦注册,但没有应用所需的类,使其坚持,我仍然得到相同的控制台错误。只需重申,这是通过cli安装在Zurb模板中,使用Handlebars/Panini结构。我已经在'./src/page/index.html'和'。/ src/pages/index.html'中试过了,但都没有成功。 – redplanet