dom-modify

1.0.0 • Public • Published

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');

Readme

Keywords

Package Sidebar

Install

npm i dom-modify

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

5.57 kB

Total Files

3

Last publish

Collaborators

  • seannhewitson