如何使用javascript在点击超链接时显示微调器 [英] How to show spinner on click of hyperlink using javascript
本文介绍了如何使用javascript在点击超链接时显示微调器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
I have a hyperlink and I am trying to add spinner when you clink on the link.
Below is the code for the spinner, but it is not working for the hyperlink.
<script type="text/javascript">
function Spinner() {
document.getElementById("spinning").style.display = "block";
document.getElementById("testdiv").style.display = "none";
}
</script>
<div id="spinning" style="display: none;">
<span>loading...</span>
</div>
<div id="testdiv">
Hello, this is link for the test url
<asp:HyperLink ID="linkurl" runat="server" NavigateUrl="~/test.aspx" OnClientClick="Spinner(); return true;">Testing</asp:HyperLink>
</div>
Can any one help me on this?
Thanks!
推荐答案
我不认为你需要一个微调器,因为你正在导航到另一个页面。当有很多东西时,我很需要旋转器处理需要花费时间,并且您希望将其显示给用户。
I don't think you need a spinner here as you are navigating to another page. Spinner is mostly needed when there is a lot of processing which takes time and you want to show it to user.
这篇关于如何使用javascript在点击超链接时显示微调器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文