Based on jQuery mobile device image cropping code, jquery Cropping
An image cropping code based on jQuery mobile devices. This is a jQuery image cropping plug-in that supports mobile device touch gestures, jquery. photoClip. As follows:
Download Online Preview source code
Implementation code.
Html code:
<Article class = "zzsc-container"> <div id = "clipArea"> </div> <input type = "file" id = "file"> <button id =" clipBtn "> capture </button> <div id =" view "> </div> </article> <script src =" js/jquery-2.1.1.min.js "type =" text/javascript"> </script> <script src = "js/iscroll-zoom.js"> </script> <script src = "js/hammer. js "> </script> <script src =" js/jquery. photoClip. js "> </script> <script> // document. addEventListener ('touchmove ', function (e) {e. preventDefault () ;}, false); $ ("# clipArea "). photoClip ({width: 200, height: 200, file: "# file", view: "# view", OK: "# clipBtn", loadStart: function () {console. log ("reading photos") ;}, loadComplete: function () {console. log ("photo read completed") ;}, clipFinish: function (dataURL) {console. log (dataURL) ;}}); </script>
Via: http://www.w2bc.com/article/jquery-mobile-cut-head-image