当我在我的基础 magellan 导航上单击任何子导航时,我收到一个未捕获的错误。它表明 top 没有在foundation.magellation.js 的第 46 行定义,请为上述问题提供任何解决方案。
//如果是固定位置,则考虑远征高度
var scroll_top = target.offset().top - settings.destination_threshold + 1;//error
scroll_top = scroll_top - expedition.outerHeight();
html:开始
<DIV class="row">
<div data-magellan-expedition="fixed">
<ul class="sub-nav">
<li data-magellan-arrival="home"><a href="#home">Home</a></li>
<li data-magellan-arrival="catalogue"><a href="#catalogue">Catalogue</a></li>
<li data-magellan-arrival="about"><a href="#js">About Us</a></li>
<li data-magellan-arrival="contact"><a href="#js">Contact Us</a></li>
</ul>
</div>
</div>
/*end*/
<script src="js/foundation/foundation.min.js"></script>
<script src="js/foundation/foundation.magellan.js"></script>
<script>
$(document).foundation({
"magellan-expedition": {
active_class: 'active', // specify the class used for active sections
threshold: 0, // how many pixels until the magellan bar sticks, 0 = auto
destination_threshold: 10,
throttle_delay: 50, // calculation throttling to increase framerate
fixed_top: 0, // top distance in pixels assigned to the fixed element on scroll
}
});
$(document).foundation();
</script>
</body>
</html>