Tool-Shack
    Preparing search index...

    Function isInViewport

    • Check if a DOM element is currently within the visible viewport

      Parameters

      • element: HTMLElement

        Target HTMLElement to check

      • offset: number = 0

        Optional margin offset in pixels to expand or shrink the viewport check boundary

      Returns boolean

      Boolean indicating whether element is in viewport