dom-modify
v1.0.0
Published
Modify dom containers ( resize, reposition )
Downloads
3
Readme
dom-modify
Install
$ npm install dom-modify
Import
// ES6
import * as modify from 'dom-modify';
// CommonJS
let modify = require('dom-modify');
Usage
The moveable element requires an absolute or fixed position, and to be positioned by top and left offsets.
#test{
.position:fixed;
top:100px;
left:50px;
}
// Pass an element through as the first parameter (targetElement).
var element = document.getElementById('test');
modify(element);
// Include a selector for the second parameter if you want the element to be repositioned when dragging a child.
// Example: a div with a title bar.
modify(element, '.titlebar');