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,则相应地更改此代码。
我正在使用 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,则相应地更改此代码。