如何快速找到是哪个元素产生的滚动
君哥
阅读:2059
2020-11-09 16:23:03
评论:0
使用下面的代码粘贴到调试工具中运行一下,然后滚动页面,就可以看到是哪个元素产生的滚动了
function findscroller(element) { element.onscroll = function () { console.log(element) } Array.from(element.children).forEach(findscroller) } findscroller(document.body)
发表评论
