Javascript 如何显示进度状态,然后使用js自动页面重定向?

Javascript 如何显示进度状态,然后使用js自动页面重定向?,javascript,jquery,html,css,angular,Javascript,Jquery,Html,Css,Angular,我想知道如何自动隐藏一些容器并使用超时来显示进度状态。完成后,它应该使用JavaScript执行自动页面重定向。这是我目前的做法: <div id="processing">Processing...</div> <div id="Phrazing...">Phrazing...</div> <div id="Exporting">Exporting...</div> <div id="Redirecting">

我想知道如何自动隐藏一些容器并使用超时来显示进度状态。完成后,它应该使用JavaScript执行自动页面重定向。这是我目前的做法:

<div id="processing">Processing...</div>
<div id="Phrazing...">Phrazing...</div>
<div id="Exporting">Exporting...</div>
<div id="Redirecting">Redirecting...</div>

<div id="processing">Processing...to show and disapear for certain seconds, then followed by:</div>
<div id="Phrazing...">Phrazing...to show and disapear for certain seconds, then followed by:</div>  
<div id="Exporting">Exporting...to show and disapear for certain seconds, then followed by:</div>
<div id="Redirecting">Redirecting...to show and disapear for certain second the also redirectes a web page export.html </div>
处理。。。
措辞。。。
导出。。。
重定向。。。
处理…显示和取消显示特定秒数,然后执行以下操作:
短语…在一定的时间内显示和取消显示,然后是:
导出…以显示和取消显示特定秒数,然后执行以下操作:
重定向…要在某一秒显示和取消显示,也会重定向网页export.html

您可以使用
setTimeout
在特定时间后显示/隐藏元素。 请参阅下面的代码,您可以从
setTimeout
调用特定函数并按顺序显示它

$(函数(){
显示处理();
函数showProcessing(){
$(“#处理”).show();
setTimeout(函数(){hideProcessing();},3000);
}
函数hideProcessing(){
$(“#处理”).hide();
showPhrazing();
}
函数showPhrazing(){
$(“#短语”).show();
setTimeout(函数(){hidePhrazing();},3000);
}
函数hidePhrazing(){
$(“#短语”).hide();
showExporting();
}
函数showExporting(){
$(“#导出”).show();
setTimeout(函数(){hideExporting();},3000);
}
函数hideExporting(){
$(“#导出”).hide();
显示重定向();
}
函数showRedirecting(){
$(“#重定向”).show();
setTimeout(函数(){hideRedirecting();},3000);
}
函数hideRedirecting(){
$(“#重定向”).hide();
setTimeout(函数(){window.location=“export.html”;},1000);
}
});

处理。。。
措辞。。。
导出。。。

将…重定向到export.html
我刚刚尝试过,但不起作用。uou能否请您帮我检查一下thw代码:提前谢谢您您需要先使用
style=“display:none”
隐藏所有div,从codepen的JS部分删除标记,因为这是多余的,在codepen中不是必需的,但在您实际的html页面中是必需的。通过进行这两项更改,您的代码将对我起作用,因此它应该对您起作用。顺便问一下,我看到您将超时值保持为30000,等于30秒,对吗?是的。非常感谢你。我现在就试一下,我刚试过,但我想我放在一起的代码有问题,它跳过了第1-5个div id,从处理开始。如果你能在代码笔上检查一下上面的代码,我会很高兴的,因为我犯了一些错误。代码对我来说很好,而且对我有用。由于您已将超时设置为30000,div将在30秒后显示和隐藏。我可以看到
连接
交换
访问
。。。etc divs,但正如您所调用的
showProcessing()
作为
$(function(){
中的第一个方法,因此它是从处理开始的。如果需要先连接,请调用
showconnection
,而不是
showconnering
。如果有帮助,请告诉我