如何快速找到页面中哪个元素产生的滚动?

it2025-03-03  24

将以下代码粘贴到浏览器console中按回车,然后产生滚动即可

function findScroller(element) { element.onscroll = function() { console.log(element)} Array.from(element.children).forEach(findScroller); } findScroller(document.body);
最新回复(0)