Notwithstanding Precautions, Misadventure

    get-element-relative-offset

    1.0.0 • Public • Published

    get-element-relative-offset

    This package exports a function to find the position of a DOM element relative to another.

    import getElementRelativeOffset from 'get-element-relative-offset';
     
    getElementRelativeOffset(
        baseElement: HTMLElement,
        // Return true if an element is the one you want to be relative to.
        to: (parent: HTMLElement) => boolean
    ): {
        top: number,
        left: number,
        bottom: number,
        right: number
    }

    Install

    npm i get-element-relative-offset

    DownloadsWeekly Downloads

    1

    Version

    1.0.0

    License

    Apache-2.0

    Unpacked Size

    119 kB

    Total Files

    13

    Last publish

    Collaborators

    • gitbook-bot
    • samypesse
    • jpreynat
    • emmerich
    • soreine