Closed divyamovva closed 8 years ago
Thanks for your answer.But here any of two sides[top-bottom left-right] only it is applying
Not sure I understand what you are saying. Can you elaborate?
i applied image bakgroundborderwidth but it is applying only on two sides not on all the sides
Can you show me your code snippet?
var newimageData = $('.image-editor').cropit('imageSrc');
$(".cropit-image-zoom-input").removeAttr('disabled');
this.options.valuedata = newimageData;
if (newimageData) {
$('.image-cropping').cropit({
imageState: {
src: newimageData,
},
allowDragNDrop: false,
imageBackground: true,
imageBackgroundBorderWidth: [100,50,30,20]
smallImage: 'stretch'
});
}
When we upload the same image which we upload previous file change event is not calling?how to solve this
I don't see any problem in your code, except you missed a ,
after imageBackgroundBorderWidth: [100,50,30,20]
. The border width issue is likely elsewhere.
To you second question, that's right. You can trigger a change
event on the file input manually.
when click on select image then after selecting a particular image and when we click on cancel file change event is calling how can we prevent this i wrote a popup in change event with empty src it is loading
I don't understand what you are trying to do. What exactly are you trying to "prevent" and why do you not want the change event to fire?
The thing which i required is on selecting an image i have to open a modal with that image so i opened that modal in the change event
OK. If you want to open a model when an image is selected and not when it's deselected from file input, you can simply check whether a file is selected or not before opening the modal -- check the value of the file input.
Thank you.It worked for me.
imageBackgroundBorderWidth: [top, right, bottom, left]
. See http://scottcheng.github.io/cropit/#docs-options-imageBackgroundBorderWidth.