You have errors in your code:
Uncaught TypeError: Cannot read property 'top' of undefined
$(".links a, .nav a").click(function (event) {
event.preventDefault();
var dest = 0;
// Error here
// vvvv
if ($(this.hash).offset().top > $(document).height() - $(window).height()) {
dest = $(document).height() - $(window).height();
} else {
dest = $(this.hash).offset().top;
}
$('html,body').animate({scrollTop: dest}, 800, 'swing');
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…