0
您好得到這個訊息: 遺漏的類型錯誤:無法未定義遺漏的類型錯誤:無法讀取未定義的偏移()屬性「頂」頂部
'scrollTop': $target.offset().top - 60
代碼塊的讀取屬性「頂」:
$('.btn-circle-cover').on('click',function (e) {
e.preventDefault();
var target = this.hash,
$target = $(target);
$('html, body').stop().animate({
'scrollTop': $target.offset().top - 60
}, 2200, 'swing', function() {
window.location.hash = target;
});
});
'$(this.hash)'是一個無效jQuery選擇。你的意思是'$(this)'? – Li357