@f/position-element

1.1.3 • Public • Published

position-element

Build status Git tag NPM version Code style

Position an element relative to another element

Installation

$ npm install @f/position-element

Usage

var position = require('@f/position-element')

function positionTooltip (tooltip, target, placement) {
  position(tooltip, target, placement)
}

API

positionElement(node, placement, options)

  • node - The DOM node you want to position
  • placement - One of top/right/bottom/left. How to position node relative to near. (e.g. top aligns the bottom edge of node with the top edge of near, horizontally centered)
  • options - Optional. Options object containing:
    • near - The DOM node you want to position node relative to. If not specified, node's offsetParent is used.
    • space - Optional. Defaults to 0. Specifies how much padding to add

Returns: void

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @f/position-element

Weekly Downloads

0

Version

1.1.3

License

MIT

Last publish

Collaborators

  • f