!function ($) {
//=================================== scroll ===================================//
$body.scrollspy({
target: '#navbar-main',
offset: navHeight
})
$window.on('load', function () {
$body.scrollspy('refresh')
})
$('#navbar-main [href=#]').click(function (e) {
e.preventDefault()
})
});
答案 0 :(得分:4)
您正在生成一个函数,但从不执行它。
!(function ($) {
//=================================== scroll ===================================//
$body.scrollspy({
target: '#navbar-main',
offset: navHeight
})
$window.on('load', function () {
$body.scrollspy('refresh')
})
$('#navbar-main [href=#]').click(function (e) {
e.preventDefault()
})
})(jQuery); // <-- Execute the function