dounao2829 2015-06-20 18:18
浏览 560
已采纳

进度条并在达到100%时显示消息

I have the below script from my JS progress bar, and I would like it to show the word "processing..." when it reaches 100%....how can I do that?

The progress bar demo url is:http://demo.w3bees.com/file-upload-with-progress/

Progress bar Java script....

$(document).ready(function() {
    /* variables */
    var preview = $('img');
    var status = $('.status');
    var percent = $('.percent');
    var bar = $('.bar');

    /* only for image preview */
    $("#image").change(function(){
        preview.fadeOut();

        /* html FileRender Api */
        var oFReader = new FileReader();
        oFReader.readAsDataURL(document.getElementById("image").files[0]);

        oFReader.onload = function (oFREvent) {
            preview.attr('src', oFREvent.target.result).fadeIn();
        };
    });

    /* submit form with ajax request */
    $('form').ajaxForm({

        /* set data type json */
        dataType:  'json',

        /* reset before submitting */
        beforeSend: function() {
            status.fadeOut();
            bar.width('0%');
            percent.html('0%');
        },

        /* progress bar call back*/
        uploadProgress: function(event, position, total, percentComplete) {
            var pVel = percentComplete + '%';
            bar.width(pVel);
            percent.html(pVel);
        },

        /* complete call back */
        complete: function(data) {
            preview.fadeOut(800);
            status.html(data.responseJSON.status).fadeIn();
        }

    });
});
  • 写回答

1条回答 默认 最新

  • dsutuyxe088689 2016-02-15 02:54
    关注

    I found that I missed to add the brand ID retrieval in the controller page.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 matlab求解平差
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
  • ¥15 安装svn网络有问题怎么办