Zoom / Drag Based Image Cropper
Heavily based off of https://github.com/craigfrancis/zoomify
Changes:
- Converted to prototypal structure
- Uses npm
- Uses Browserify
- Mouse wheel zoom is off
- Added scroller based zoom
- Image size is contrained by its outer div = image cannot be smaller than the div
Installation
npm installnpm install -g jade // Builds demo and runs live compilation of jade, scss, and javascript via browserifynpm start
Usage
var ImageZoomCropper = ;var dom = ; // Pane resize is pptionalvar izc = src: '../images/f1.jpg' paneResize: height: min: 225 max: 900 width: min: 225 max: 800 ; var prependEl = document;prependEl; var btnEnable = document;var btnDisable = document; dom;dom; // event callback to get translated coords// translated coordinates = crop coords for the original image sizeizc; izc; izc;