【发布时间】:2015-07-16 20:47:09
【问题描述】:
我正在尝试调整缩略图中的图像大小以修复框大小。我试过这个:
Dropzone.options.myAwesomeDropzone = {
maxFiles: 20,
maxFilesize: 2,
maxThumbnailFilesize: 20,
acceptedFiles: 'image/*,.jpg,.png,.jpeg',
thumbnailWidth:"250",
thumbnailHeight:"250",
init: function() {
var dropzone = this, xhrs = [];
$.each(uploadedImages, function (index, path) {
var xhr = new XMLHttpRequest();
xhr.open('GET', path);
xhr.responseType = 'blob';//force the HTTP response, response-type header to be blob
xhr.onload = function() {
var file = new File([xhr.response], '', {'type': xhr.response.type});
//dropzone.addUploadedFile(file);
dropzone.emit("addedfile", file);
dropzone.emit("thumbnail", file, path);
dropzone.emit("complete", file);
};
xhrs.push(xhr);
xhr.send();
});
this.options.maxFiles = this.options.maxFiles - uploadedImages.count;
}
};
这就是它的显示方式:
我也试过了:
thumbnailWidth:"300",
thumbnailHeight:"300",
===
thumbnailWidth:"400",
thumbnailHeight:"400",
但是什么都没变,thumbnailWidth and thumbnailHeight没有效果
【问题讨论】:
标签: javascript jquery html css dropzone.js