点击浏览器后退按钮再次显示加载div [英] click on browser back button show loading div again
本文介绍了点击浏览器后退按钮再次显示加载div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
function loading(){
document.getElementById("load").style.display = 'block';
}
<div id="load" style="display:none;background-color:rgba(0, 0, 0, 0.2);">
<div id="loadmain">
<img style="margin-top:10px;" src="Images/loading.gif" alt="loading" />
<br />
<h1 style="color:black;">Please Wait...</h1>
</div>
</div>
加载div在母版页中。
假设我有三页: -
具有搜索按钮的第一页
Loading div is in master page.
Assume i have three pages:-
First page having search button
<asp:Button ID="but_adidsearch" runat="server" OnClientClick="return termvalidate()"
Text="" onclick="but_adidsearch_Click" />
i点击搜索按钮并加载div show然后结果显示在第二页。
当我转到第三页时单击浏览器后退按钮然后再次出现加载div并保持在页面中直到我刷新页面URL。
为什么它再次显示。
i click on search button and loading div show and then results are show in the second page.
and when i go to third page and click browser back button then the loading div is occur again and stay in the page till i refresh the page url.
Why it is again showing.
推荐答案
如果它在主页上,那么每次想要更改div时都必须更新div的状态。
我认为这个jQuery代码可以帮助你在这里:
If it's on the masterpage, then you will have to update the div's status everytime you want it to be changed.
I think this jQuery code can help you here:
(< span class =code-sdkkeyword> document )。ready( function (){
(document).ready(function(){
( #load)。hide();
});
("#load").hide(); });
把它放在你的主页上。
put it on your masterpage.
这篇关于点击浏览器后退按钮再次显示加载div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文