We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
document.body.onscroll = () => console.log('body onscroll') // 正常, 和window.onscroll相互覆盖 document.body.addEventListener('scroll', () => console.log('body addEventListener')) // 无效 document.onscroll = () => console.log('document onscroll') // 正常 document.addEventListener('scroll', () => console.log('document addEventListener')) // 正常 document.documentElement.onscroll = () => console.log('documentElement onscroll') // 无效 document.documentElement.addEventListener('scroll', () => console.log('documentElement addEventListener')) // 无效 window.onscroll = () => console.log('window onscroll') // 正常,和document.body.onscroll 相互覆盖 window.addEventListener('scroll', () => console.log('window addEventListener')) // 正常 说明: - 在滚动body时,document对scroll的监听也会被触发 - 这些感觉有点凌乱的API应该是浏览器历史遗留问题,平常的话监听document即可 - 测试环境(userAgenet):Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: