Setting minimun height and width of cropbox:-
Hello Readers!
In this blog I am going to explain you minheight and minwidth of a cropbox, which is used in the Cropper Jquery Plugin for selecting an image to crop, By default this Cropbox size is fixed to a ratio, but when you resize this crop-box, this will go to minimum height and width to "Zero". This value is by default defined in cropper.js file.
Here i have done some changes that will be able to change its minheight and minwidth by using the jquery function. That will able to set the cropBox minheight and minwidth to 100px or you can set this as according to your requirement. Download the below zip file then open main.js file in your file editor, add the following code there in the jquery function. This will able to set Cropbox minimum height and width to 100px.
Source Code:
$(function () {
var options = {
aspectRatio: 1/ 1,
minCropBoxWidth: 100,
minCropBoxHeight: 100,
}
};
For knowing more about the cropper jquery you can read my previous blog "Explaination of Cropper Jquery Plugin", That will help you to understand the whole code or I am attaching the zip file here for better understand the above code.
0 Comment(s)