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
一直以来我们要监控2个元素的相对位置,总是比较麻烦的,而且之前也只能通过js以及每个元素的top值来控制,这也极易拖慢整个网站的性能。然而,随着网页的发展,对上述检测的需求也随之增加,多种情况下都需要用到元素交集变化的信息。
Intersection Observer的出现,解决了这个问题,Intersection Observer API 会在浏览器注册一个观察者,并且可以设定据地要观察的目标(target),当目标元素(target)以及根元素或者指定的外层元素(root元素)相互交叉的时候触发事件。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
event-loop
流程
IntersectionObserver
一直以来我们要监控2个元素的相对位置,总是比较麻烦的,而且之前也只能通过js以及每个元素的top值来控制,这也极易拖慢整个网站的性能。然而,随着网页的发展,对上述检测的需求也随之增加,多种情况下都需要用到元素交集变化的信息。
Intersection Observer的出现,解决了这个问题,Intersection Observer API 会在浏览器注册一个观察者,并且可以设定据地要观察的目标(target),当目标元素(target)以及根元素或者指定的外层元素(root元素)相互交叉的时候触发事件。
The text was updated successfully, but these errors were encountered: