我收到JavaScript错误:
未捕获的TypeError:$(...)。affix不是函数
我已按此顺序在我的视图页面上加载了所有JS
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script type="text/javascript" src="/presents/shawnee/designs/javascripts/libs/bootstrap.min.js"></script>
<script type="text/javascript" src="/presents/shawnee/designs/javascripts/libs/jquery.cookie.js"></script>
<script type="text/javascript" src="/presents/shawnee/designs/javascripts/libs/imagesloaded.pkgd.min.js"></script>
<script type="text/javascript" src="/presents/shawnee/designs/javascripts/libs/jquery.lazyload.min.js"></script>
<script type="text/javascript" src="/presents/shawnee/designs/javascripts/libs/masonry.pkgd.min.js"></script>
<script type="text/javascript" src="/presents/shawnee/designs/javascripts/libs/jquery.placeholder.js"></script>
<script type="text/javascript" src="/presents/shawnee/designs/javascripts/libs/googleDirections.js"></script>
<script type="text/javascript" src="/presents/shawnee/designs/javascripts/libs/scripts.js"></script>
这是词缀代码
// Sticky navbar desktop only
$('#navbar-fixed').affix({
offset: {
top: function() {
return (this.top = $('#masthead').outerHeight(true) + $('#navbar-fixed').height());
}
}
})
// For a subpage called 'tools'. Creates sticky sidebar
$('#tools-sticky-nav').affix({
offset: {
top: function() {
return (this.top = $('#masthead').outerHeight(true))
}
}
})