当我在我的基础麦哲伦导航上点击任何子导航时,我得到了一个错误,未捕获的错误。它显示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>发布于 2014-10-14 04:32:20
添加与子导航中的项目相对应的data-magellan-destination属性。它正在尝试计算需要滚动到的位置,但没有定义目标。例如,您可能会在页面下面的部分中使用以下属性:
<div data-magellan-destination="home">home content here</div>
<div data-magellan-destination="catalogue">catalogue content here</div>等。
https://stackoverflow.com/questions/26193489
复制相似问题