繁体   English   中英

JSAjaxFileUploader上传后显示图像

[英]JSAjaxFileUploader show image after upload

我正在使用JSAjaxFileUploader,但是在文件自动滑出后找不到任何选项可在文件上传后显示缩略图。

在文档中也没有此选项。

由于插件中没有此类功能,因此我们必须编辑核心插件文件。

在JSAjaxFileUploader.js文件中,找到以下行:

$eml.slideUp(settings.closeAnimationSpeed,function(){$eml.remove();});

删除此行,而是添加以下内容:

$('.JSOprIcons img[title="Stop Upload"]', $eml).remove();
$('.JSpercent', $eml).html('Uploaded');
$('.JSProgressBarParent', $eml).remove();
var thisFileSize = $('.JSsize', $eml).html();
var thisFileSizeShort = thisFileSize.substr(0, thisFileSize.indexOf('/'));
$('.JSsize', $eml).html(thisFileSizeShort);

我将多个文件选项设置为默认,因此我也将添加以下代码:

$('form ul.JSpreveiw li:not(:last-child)').slideUp(settings.closeAnimationSpeed,function(){$('form ul.JSpreveiw li:not(:last-child)').remove()});

但是,如果您将多个文件设置为大于1,则相应地更改此代码。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM