我正在使用 jQuery Croppie lib 来裁剪用户上传的文件。当用户上传文件时,我打开用户可以裁剪图像的模式。之后我想将此裁剪图像设置为文件输入值,以便用户可以在一切准备就绪后提交表单,但我不知道如何“设置”裁剪图像作为输入值。
这是我的代码。
$scope.openCropModal = function(files) {
if (!(files[0] instanceof Object) || (fileUploadMaxSize * 1100000) < files[0].size) {
Alertify.alert('File size must be less than ' + fileUploadMaxSize + 'mb');
return false;
}
$('#cropLogoModal').modal({});
var $uploadCrop = $('#cropperMainContainer').croppie({
viewport: {
width: 200,
height: 200,
type: 'square'
},
boundary: {
width: 300,
height: 300
},
enableExif: true,
enableOrientation: true,
orientation: 4,
});
var reader = new FileReader();
reader.onload = function (e) {
$uploadCrop.croppie('bind', {
url: e.target.result
}).then(function() {
}); …Run Code Online (Sandbox Code Playgroud) 考虑一下我正在运行,并且我的远程名称上master有远程分支,一切都是最新的,我已经运行了。developorigingit fetch
git merge origin/develop现在和之间有什么区别吗git pull origin develop?
有什么区别
$(function() {
// bind some event listeners
});
Run Code Online (Sandbox Code Playgroud)
和
$(function() {
// bind some event listeners
}());
Run Code Online (Sandbox Code Playgroud) javascript jquery closures addeventlistener self-invoking-function
例如,如何将选定的代码转换为蛇形(或骆驼形或其他来自实时模板变量选项的标准表达式)
jetbrains-ide intellij-idea live-templates phpstorm webstorm