Jos*_*art 4 javascript jquery file-upload blueimp
我正在实现Blueimp jQuery File Uploader https://github.com/blueimp/jQuery-File-Upload,我想在添加第一个图像后更改previewMaxWidth和previewMaxHeight.这是因为我有产品特征图像,然后是产品的后续视图,每个视图应显示小于特征图像.
这是我的文件上传调用:
$('.imageupload').fileupload({
autoUpload : true,
acceptFileTypes : /(\.|\/)(gif|jpe?g|png)$/i,
previewMaxWidth : 198,
previewMaxHeight : 800,
uploadTemplateId : 'product-add-image-upload',
downloadTemplateId : 'product-add-image-download'
}).bind('fileuploadadded', function(e, data) {
// change preview width/height to 60px/60px after first image loaded
// not sure what to put here
});
Run Code Online (Sandbox Code Playgroud)
存在option
param,允许在窗口小部件初始化后更改选项.
根据你的代码:
...
}).bind('fileuploadadded', function(e, data) {
$('.imageupload').fileupload(
'option',
{
previewMaxWidth: 60,
previewMaxHeight: 60
}
);
});
Run Code Online (Sandbox Code Playgroud)
有关更改选项的更多信息,请参阅官方API页面(选项部分).
归档时间: |
|
查看次数: |
5912 次 |
最近记录: |