Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/stagas/get-element-offset

Get accurate DOM element offset.
https://github.com/stagas/get-element-offset

dom element offset

Last synced: 14 days ago
JSON representation

Get accurate DOM element offset.

Awesome Lists containing this project

README

        


get-element-offset

Get accurate DOM element offset.



npm i get-element-offset

pnpm add get-element-offset

yarn add get-element-offset

## API

# getElementOffset(el, maxDepth)

    # el


      HTMLElement

    # maxDepth  =  Infinity

      number


    getElementOffset(el, maxDepth)  =>


      {

      # x


        number

      # y

        number

      }

## Contributing

[Fork](https://github.com/stagas/get-element-offset/fork) or [edit](https://github.dev/stagas/get-element-offset) and submit a PR.

All contributions are welcome!

## License

MIT © 2022 [stagas](https://github.com/stagas)