const spinnerBox = $('#spinner-box') const catalog = $('.catalog') $.ajax({ type: "GET", url: "", cache: true, // data: "data", // dataType: "dataType", success: function (response) { setTimeout(()=>{ $(spinnerBox).addClass('not-visible') $(catalog).removeClass('not-visible') },3) }, error: function (error) { console.log(error) } });