Picture cropping upload plugin--jquery.photoclip.js

Source: Internet
Author: User

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" &GT;&LT;/SCRIPT&GT;&LT;SCRIPT&GT;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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.