【问题标题】:JSAjaxFileUploader show image after uploadJSAjaxFileUploader 上传后显示图片
【发布时间】:2015-03-24 09:09:37
【问题描述】:

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

文档中也没有此选项。

【问题讨论】:

    标签: javascript ajax file upload jsajaxfileuploader


    【解决方案1】:

    由于插件中没有这样的功能,我们将不得不编辑核心插件文件。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-11-12
      • 1970-01-01
      • 2012-03-13
      • 2013-03-28
      • 2014-03-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多