I have a box to wait for and I want the box to be displayed first and removed after 5 seconds. I wrote two jquery function for him One for show and one for no show The first function works correctly But when I call the second function, the principles of the first function do not work and none of the functions are executed.
protected void Page_Load(object sender, EventArgs e)
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "OpenWaitingPagePopup()", true);
System.Threading.Thread.Sleep(5000);
Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction2", "CloseWaitingPagePopup()", true);
}
and my jquery functios is :
<script type="text/javascript">
function OpenWaitingPagePopup() {
$(".waiting-loader-layer").fadeIn("fast");
}
function CloseWaitingPagePopup() {
$(".waiting-loader-layer").fadeOut();
}
</script>
and my waiting popup is :
<!-- waiting popup -->
<div class="waiting-loader-layer">
<div class="inner">
<img src="https://www.pekbag.ir/images/ajax-loader-cs.gif" width="50" height="50">
<span> Please wait ... </span>
</div>
</div>
The jQuery file has also been added to the page correctly.