offsetFromParent

Type:Function
Status:stable
Since:1.0.0
Platform:js
@blackbyte.sugar.js.dom.offset

Get the offset top and left of the passed element from his parent top left point

Params

  1. $elm*-HTMLElement

    The element to get the offset from

Return

  1. -top: number; left: number;

    The offset top and left object

Example

import { offsetFromParent } from '@blackbyte/sugar/dom'
const offsetFromParentElm = offsetFromParent($elm);
// output : { top : 200, left : 300 }

Todo

  • testsnormal