Div container just keep the last div and do not accumulate

0

The JS I use fills the div class .ajax-file-upload-container

is filled with another div

<div class="ajax-file-upload-statusbar" style="display: none; width: 420px;">

and while it is still selected with the file element it will continue to accumulate like this

<div class="ajax-file-upload-container">
<div class="ajax-file-upload-statusbar" style="display: none; width: 420px;">contenido ultimo</div>
<div class="ajax-file-upload-statusbar" style="display: none; width: 420px;">contenido2</div>
<div class="ajax-file-upload-statusbar" style="display: none; width: 420px;">contenido 1</div>
</div>

I tried not to accumulate to only get the div only the last one, I thought to use. html but the theme is that I tried but I do not know what line to play Any ideas?

The goal is to obtain this result

<div class="ajax-file-upload-container">
<div class="ajax-file-upload-statusbar" style="display: none; width: 420px;">contenido ultimo</div>
</div>

This is the js jquery.uploadfile.min.js

Here, download it link

    
asked by Eduardo Palomino 21.06.2017 в 17:20
source

1 answer

0

if it came out thanks friends

function defaultProgressBar (obj, s)         {             // alert (s);             this.statusbar = $ (""). width (s.statusBarWidth);

        this.preview = $("<img class='ajax-file-upload-preview' />").width(s.previewWidth).height(s.previewHeight).appendTo(this.statusbar).hide();
        this.filename = $("<div class='ajax-file-upload-filename'></div>").appendTo(this.statusbar);
        this.progressDiv = $("<div class='ajax-file-upload-progress'>").appendTo(this.statusbar).hide();
        this.progressbar = $("<div class='ajax-file-upload-bar'></div>").appendTo(this.progressDiv);
        this.abort = $("<div>" + s.abortStr + "</div>").appendTo(this.statusbar).hide();
        this.cancel = $("<div>" + s.cancelStr + "</div>").appendTo(this.statusbar).hide();
        this.done = $("<div>" + s.doneStr + "</div>").appendTo(this.statusbar).hide();
        this.download = $("<div>" + s.downloadStr + "</div>").appendTo(this.statusbar).hide();
        this.del = $("<div>" + s.deletelStr + "</div>").appendTo(this.statusbar).hide();

        this.abort.addClass("ajax-file-upload-red");
        this.done.addClass("ajax-file-upload-green");
        this.download.addClass("ajax-file-upload-green");
        this.cancel.addClass("ajax-file-upload-red");
        this.del.addClass("ajax-file-upload-red");          
        // aqui mi aporte $(".ajax-file-upload-container").html(" ");

        return this;
    }
    
answered by 21.06.2017 в 18:13