📜  ionic josh morony 中的交集 - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:22.184000             🧑  作者: Mango

代码示例1
// Create the observer
    this.observer = new IntersectionObserver((entries) => {

      entries.forEach((entry: any) => {

        if(entry.isIntersecting){
          // do something if intersecting
        } else {
          // do something if not intersecting
        }
      })

    });

    // Use the observer on specific elements
    this.items.forEach(item => {
      this.observer.observe(item.nativeElement);
    });