在不同列表滚动时,他们滚动的不是自身容器,而是body页面在滚动。
查找滚动元素的方法:
function findScroller(element) {
element.onscroll = function() {
console.log(element)
}
Array.from(element.children).forEach(findScroller)
}
findScroller(document.body)
解决方法:
让每个列表产生自己的滚动容器
.article-list {
height: 100%;
overflow-y: auto;
}