Friends who have used Sina Weibo may have an impression of its avatar editor. However, it is made with flash. In a project, the same thing was used. I originally wanted to use Sina Weibo directly. But part of the request path was written into FLASH, so I had to give up. I found jquery.Jcrop on the Internet, which basically met my needs, but it was just a simple cutting, and thumbnails were not generated. Maybe many people need this kind of thing, so I encapsulated it so that other friends can use it directly. Official website: http://deepliquid.com/content/Jcrop.html There are many above If you are interested, you can check out the demo. In this article, the encapsulated JS is as follows:
var cutter = new jQuery.UtrialAvatarCutter( { //Container ID where the main picture is located content: "picture_original", //Thumbnail configuration, ID: Container ID ;width,height: thumbnail size purviews: [{id:"picture_200",width:200,height:200},{id:"picture_50",width:50,height:50},{id:" picture_30",width:30,height:30}], //Default size of the selector selector : {width:200,height:200} } );
5. If you use ajax to upload images, you can use cutter.reload(imgs_url) to modify them instantly Image path File package downloadhttp://www.jb51.net/jiaoben/24767.html
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn