如何在不将 onscroll 处理程序附加到每个容器的情况下捕获页面上的所有滚动事件 [英] How to capture all scrolling events on a page without attaching an onscroll handler to every single container
本文介绍了如何在不将 onscroll 处理程序附加到每个容器的情况下捕获页面上的所有滚动事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
考虑以下网页:
<body onscroll="alert('body scroll event')"><div style='width:200px;height:200px;overflow:auto' onscroll="alert('div scroll event')"><div style='height:400px'>