0.3.0 • Published 5 years ago

@kanety/jquery-simple-resize v0.3.0

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

jquery-simple-resize

A jquery plugin for simple resizable element.

Dependencies

  • jquery

Installation

Install from npm:

$ npm install @kanety/jquery-simple-resize --save

Usage

Build html as follows:

<div id="resize">
  <div>text</div>
</div>

Then run:

$('#resize').simpleReize({
  bottomRight: true
});

Options

Build resize handler automatically in the resizable element:

$('#resize').simpleReize({
  top: true,
  bottom: true,
  left: true,
  right: true,
  topLeft: true
  topRight: true
  bottomLeft: true
  bottomRight: true
});

Specify selector out of the resizable element:

<div id="resize">
  <div>text</div>
</div>
<div id="resize_bottom"></div>
$('#resize').simpleReize({
  bottom: '#resize_bottom'
});

Store current width and height in the web storage:

$('#resize').simpleReize({
  store: 'session',  // or 'local'
  storeKey: 'YOUR_KEY'
});

Callbacks

$('#resize').simpleResize({
  ...
}).on('resize:start', function(e, $handler) {
  ...
}).on('resize:move', function(e, $handler) {
  ...
}).on('resize:end', function(e, $handler) {
  ...
});

License

The library is available as open source under the terms of the MIT License.