我有一个代码:
(function($) {
$(window).scroll(function() {
if ($(this).scrollTop() >= 50) { // If page is scrolled more than 50px
$('#return-to-top').fadeIn(200); // Fade in the arrow
} else {
$('#return-to-top').fadeOut(200); // Else fade out the arrow
}
});
$('#return-to-top').click(function() { // When arrow is clicked
$('body,html').animate({
scrollTop : 0 // Scroll to top of body
}, 500);
});
})(jQuery);
在 Chrome 中,我将截断页面。然后我在控制台中得到一个错误。
> Uncaught TypeError: Cannot read property 'nodeName' of null
>> at _e (index.js:63)
>>> at MutationObserver.<anonymous> (index.js:63)
Wordpress 中的页面。任何人都可以帮忙吗?