javascript Intersection Observer API示例
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javascript Intersection Observer API示例相关的知识,希望对你有一定的参考价值。
const observeScroll = (element, callback) => {
const observer = new IntersectionObserver(([entry]) => {
if (entry.intersectionRatio < 1) return;
callback();
// Stop watching the element
observer.disconnect();
},{
threshold: 1
});
// Start watching the element
observer.observe(element);
};
const element = document.getElementById("express-animation");
observeScroll(element, startAnimation);
以上是关于javascript Intersection Observer API示例的主要内容,如果未能解决你的问题,请参考以下文章
CSU 1811 Tree Intersection(平衡树的子树合并)
LeetCode Intersection of Two Linked Lists
LeetCode Intersection of Two Linked Lists
Union and Intersection of two sorted list
[LeetCode] 160. Intersection of Two Linked Lists
349. Intersection of Two Arrays