我想創建錨鏈接滾動,並與引導類型錯誤:m.easing [this.easing]是不是一個函數錯誤
$(window).scroll(function(){
if ($(window).scrollTop() >= 100) {
$('#header').addClass('fixed');
}
else {
$('#header').removeClass('fixed').fadeOut("slow", 100);
}
$('[data-toggle="tooltip"]').tooltip();
});
$(function() {
$('a.page-scroll').bind('click', function(event) {
var $anchor = $(this);
$('html, body').stop().animate({
scrollTop: $($anchor.attr('href')).offset().top
}, 1500, 'easeInOutExpo');
event.preventDefault();
});
});
$(function() {
$('a.scroll').bind('click', function(event) {
var $anchor = $(this);
$('html, body').stop().animate({
scrollTop: $($anchor.attr('href')).offset().top
}, 1500, 'easeInOutExpo');
event.preventDefault();
});
});
工具提示顯示,但我在控制檯 收到此錯誤類型錯誤:m.easing [this.easing]不是函數
演示鏈接 http://itracktraining.com/bb2/index.html
錯誤仍然存在,甚至根據你做的更改後.... –
@DivyaSharma請參閱我的更新答案,其中包括對使用fadeOut'的'解釋。 – shennan