查看页面滚动节点

将下面代码在浏览器中执行,就会打印滚动的节点

1
2
3
4
5
function findScroller(element){
element.onscroll = function(){console.log(element)}
Array.from(element.children).forEach(findScroller)
}
findScroller(document.body)