1.1.3 • Published 9 years ago
@f/position-element v1.1.3
position-element
Position an element relative to another element
Installation
$ npm install @f/position-elementUsage
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 positionplacement- One oftop/right/bottom/left. How to positionnoderelative tonear. (e.g.topaligns the bottom edge ofnodewith the top edge ofnear, horizontally centered)options- Optional. Options object containing:near- The DOM node you want to positionnoderelative to. If not specified,node's offsetParent is used.space- Optional. Defaults to0. Specifies how much padding to add
Returns: void
License
MIT