我继续在 Uncaught TypeError 的主页上收到错误:无法使用此代码读取 null 的属性“顶部”。
// Load Carousel on Scroll.
$(window).scroll(function () {
$loadedContainer = $('.pane-idevels-browse-genres-custom-content-load .pane-content');
offsetY = $loadedContainer.offset().top;
cH = $loadedContainer.outerHeight();
wH = $(window).height();
bodyScroll = $('body').scrollTop();
htmlScroll = $('html').scrollTop();
scrollTop = (bodyScroll == 0) ? htmlScroll : bodyScroll;
carouselOffset = offsetY + cH;
windowOffset = wH + scrollTop;
if (carouselOffset <= windowOffset) {
loadCarouselGenres($loadedContainer)
}
})