Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

343
Views
spinner does not appear while a file upload is processing

I want to show a spinner while uploading a video is processing
But after choosing a file spinner simply does not appear

html

<div class='spwrap' id='spwrap'>
<img class='spinner' src='spinner.gif' alt='img'>
</div>

css

.spwrap{
    display:none;
}

js

var spwrap = $('#spwrap'); // this is spinner wrap

inpfile.on('change', function(){
    spwrap.slideDown();  // doesn't slide
    var f = inpfile[0].files[0];
    var fd = new FormData();
    fd.append('inpfile', f);
    $.ajax({
        url: 'upload.php',
        type: 'POST',
        data: fd,
        async: false,
        contentType: 'multipart/form-data',
        success: function (data){
            console.log(data);
            spwrap.slideUp();  // sometimes shortly slideDown and slideUp immediately
    },
    cache: false,
    contentType: false,
    processData: false
  });
});

I also tried spwrap.show() instead of slideDown - the same result

how to solve this ?

update

I tried:

inpfile.on('change', function(){
    spwrap.slideDown();
    // the rest of code is removed
});

and it works i.e. spwrap is visible

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!