1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| <script type="text/javascript">
$(function() {
$('#UploadImages').uberuploadcropper({
//---------------------------------------------------
// uploadify options..
//---------------------------------------------------
//'debug' : true,
'action' : 'upload.php',
'params' : {},
'allowedExtensions': ['jpg','jpeg','png','gif'],
//'sizeLimit' : 0,
'multiple' : false,
//---------------------------------------------------
//now the cropper options..
//---------------------------------------------------
//'aspectRatio': 1,
'allowSelect': false, //can reselect
'allowResize' : true, //can resize selection
'setSelect': [ 0, 0, 200, 200 ], //these are the dimensions of the crop box x1,y1,x2,y2
'minSize': [ 200, 200 ], //if you want to be able to resize, use these
'maxSize': [ 1000, 1000 ],
//---------------------------------------------------
//now the uber options..
//---------------------------------------------------
'folder': 'uploads/', // only used in uber, not passed to server
'cropAction': 'crop.php', // server side request to crop image
'onComplete': function(imgs,data){
var $PhotoPrevs = $('#PhotoPrevs');
for(var i=0,l=imgs.length; i<l; i++){
$PhotoPrevs.append('<img src="uploads/'+ imgs[i].filename +'?d='+ (new Date()).getTime() +'" />');
//document.getElementByID('imageup').value = 'success';
}
}
});
});
</script> |
Partager