Skip to content

dy/placer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Placer

Place any two DOM elements in a way you like. Mainly needed for dropdowns, tooltips, modals, notifiers and any kind of overlays.

Demo & tests

Usage

npm install placer

var place = require('placer');

place(element, {
	target: otherElement,
	side: 'top',
	align: 'left',
	within: '.holder'
})

Options

Parameter Default Description
target window An area to align element relative to.
side undefined The side to place element: 'center', 'top', 'left', 'bottom', 'right' or 'auto'.
align 'left' Alignment, 0..1 or one of the sides keywords.
within window Restriction area.

Alternatives

About

Place any element relative to any other element the way you define

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published