To crop an image upload:
The plugins you need to rely on are:
[Jquery.photoClip.js] Plug-in
[Iscroll-zoom.js] Plug-in
[Hammer.js] Plug-in
[Lrz.all.bundle.js] Plug-in
[Jquery-2.1.3.min.js]
On the front-end page, pick:
<div id= "Cliparea" ></div><input type= "file" id= "file" ><button id= " Clipbtn "> Intercept </button><div id=" View "></div><script src=" Js/jquery-2.1.3.min.js "></script><script src=" Js/hammer.min.js "></script><script src=" js/ Iscroll-zoom.min.js "></script><script src=" Js/lrz.all.bundle.js "></script><script src= "Js/jquery.photoclip.js" ></SCRIPT><SCRIPT>VAR&NBSP;CLIPAREA&NBSP;=&NBSP;NEW&NBSP;BJJ. Photoclip ("#clipArea", { size: [260, 260], // an array of the width and height of the capture box. The default value is an array of width and height of the [260,260] outputsize: [640, 640], // output image. The default value is [0,0], which indicates the output image original size //outputType: "JPG", // specifies the type of output picture, optional "JPG" and "PNG" two types, default "JPG" file: "#file", // upload images < Input type= the selector or DOM object of the "file" > Control &Nbsp; view: "#view", // displays the container selector or DOM object of the captured image ok: " #clipBtn the, // Confirmation button selector or DOM object loadstart: function (file) {}, // begins loading the callback function. This points to the fileReader object and passes in the loaded file object as a parameter loadComplete: function (SRC) {}, // load completed callback functions. This points to the picture object and passes the picture address as a parameter to the loaderror: function (event) {}, // load failed callback function. This points to the fileReader object and passes in the event object of the error event as a parameter clipFinish: function (Dataurl) {}, // clipping completed callback functions. This points to the picture object, which passes the cropped image data Dataurl as a parameter});</script>
Picture cropping upload plugin--jquery.photoclip.js