Вы можете использовать setTimeout
, чтобы показать / скрыть элемент после определенного времени. Ниже приведен код, где вы можете вызывать конкретную c функцию из setTimeout
и показывать ее последовательно
$(function(){
showProcessing();
function showProcessing() {
$('#processing').show();
setTimeout(function(){ hideProcessing();}, 3000);
}
function hideProcessing() {
$('#processing').hide();
showPhrazing();
}
function showPhrazing() {
$('#Phrazing').show();
setTimeout(function(){ hidePhrazing();}, 3000);
}
function hidePhrazing() {
$('#Phrazing').hide();
showExporting();
}
function showExporting() {
$('#Exporting').show();
setTimeout(function(){ hideExporting();}, 3000);
}
function hideExporting() {
$('#Exporting').hide();
showRedirecting();
}
function showRedirecting() {
$('#Redirecting').show();
setTimeout(function(){ hideRedirecting();}, 3000);
}
function hideRedirecting() {
$('#Redirecting').hide();
setTimeout(function(){window.location = "export.html";}, 1000);
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="processing" style="display:none">Processing...</div>
<div id="Phrazing" style="display:none">Phrazing...</div>
<div id="Exporting" style="display:none">Exporting...</div>
<div id="Redirecting" style="display:none">Redirecting...to export.html </div>