1.2.1 • Published 6 years ago

resizable v1.2.1

Weekly downloads
70
License
MIT
Repository
github
Last release
6 years ago

Resizable

Resizable behaviour for elements. Demo.

npm install resizable

var Resizable = require('resizable');

var el = document.querySelector('.my-element');


var resizable = new Resizable(el, {
	within: 'parent',
	handles: 's, se, e',
	threshold: 10,
	draggable: false
});

resizable.on('resize', function(){
	//...
});

Options

ParameterDefaultDescription
handles*List of handles to support. Valid handles: s, se, e, ne, n, nw, w, sw. May be specified as an object, array, or comma-separated string.
resizeundefinedResize event handler.
threshold10A movement threshold required to start resize - whether array, number or function.
withindocumentRestrict movement within the container. Pass 'parent' to take parent node.
draggablefalseMake element draggable as well. Set an object to pass options to draggable.
css3trueUse translate3d for defining position.

* Default handles are dependent on the styling of the given element. Inline elements will default to s, se, e, while elements that can support full resize will default to all handles being enabled.

Events

NameDescription
resizestartElement resize started. Called on self.
resizeElement resized. Called on self.
resizeendElement resize ended. Called on self.
1.2.1

6 years ago

1.2.0

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.5

8 years ago

1.0.4

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.2

10 years ago