JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q24245F
  • License ISC

a jQuery plugin for resize element

Package Exports

  • j-resize

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 (j-resize) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

j-resize

a jQuery plugin for resize element

@params

jResize(opt);
minW: 100,      // 最小宽度
maxW: 300,      // 最大宽度
minH: 100,      // 最小高度
maxH: 300,      // 最大高度
noX: false,     // X 轴不可拖动
noY: false,     // Y 轴不可拖动
callback:       // 回调函数 obj (当前元素改变后的宽高,如属性未改变,则为 null)

obj = {
    width: null,
    height: null
}

Usage

// es6:     npm install jquery && j-resize
import $ from "jquery";
require("j-resize");

// browser:
<script src="jquery.js"></script>
<script src="j-resize.js"></script>

$(function() {
    $(".drag").jResize({
        minW: 150,
        minH: 150,
        maxW: 500,
        maxH: 500,
        noY: true,
        callback: function(obj) {
            console.dir(obj);
        }
    });
})