JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1253
  • Score
    100M100P100Q119764F
  • License MIT

Resizable behaviour for elements

Package Exports

  • resizable
  • resizable/resizable.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (resizable) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Resizable

Resizable behaviour for elements. Demo.

npm install resizable

import Resizable from 'resizable';

var resizable = new Resizable(document.querySelector('.my-element'), {
    within: 'parent',
    handles: 's, se, e',
    threshold: 10,
    draggable: false
});

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

Options

Parameter Default Description
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.
resize undefined Resize event handler.
threshold 10 A movement threshold required to start resize - whether array, number or function.
within document Restrict movement within the container. Pass 'parent' to take parent node.
draggable false Make element draggable as well. Set an object to pass options to draggable.
css3 true Use 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

Name Description
resizestart Element resize started.
resize Element resized.
resizeend Element resize ended.

License

MIT

🕉