@yesstudio/nuxt-composables
    Preparing search index...

    Interface IntersectionObserver

    The IntersectionObserver interface of the Intersection Observer API provides a way to asynchronously observe changes in the intersection of a target element with an ancestor element or with a top-level document's viewport.

    MDN Reference

    interface IntersectionObserver {
        root: Element | Document | null;
        rootMargin: string;
        thresholds: readonly number[];
        disconnect(): void;
        observe(target: Element): void;
        takeRecords(): IntersectionObserverEntry[];
        unobserve(target: Element): void;
    }
    Index

    Properties

    root: Element | Document | null

    The IntersectionObserver interface's read-only root property identifies the Element or of the viewport for the element which is the observer's target.

    MDN Reference

    rootMargin: string

    The IntersectionObserver interface's read-only rootMargin property is a string with syntax similar to that of the CSS margin property.

    MDN Reference

    thresholds: readonly number[]

    The IntersectionObserver interface's read-only thresholds property returns the list of intersection thresholds that was specified when the observer was instantiated with only one threshold ratio was provided when instantiating the object, this will be an array containing that single value.

    MDN Reference

    Methods

    • The IntersectionObserver method disconnect() stops watching all of its target elements for visibility changes.

      MDN Reference

      Returns void

    • The IntersectionObserver method observe() adds an element to the set of target elements being watched by the IntersectionObserver.

      MDN Reference

      Parameters

      Returns void

    • The IntersectionObserver method takeRecords() returns an array of has experienced an intersection change since the last time the intersections were checked, either explicitly through a call to this method or implicitly by an automatic call to the observer's callback.

      MDN Reference

      Returns IntersectionObserverEntry[]

    • The IntersectionObserver method unobserve() instructs the IntersectionObserver to stop observing the specified target element.

      MDN Reference

      Parameters

      Returns void