我在我的页面中使用ajax throbber。
Throbber 工作正常。但是,我想在 throbber 运行时隐藏背景。
这是我正在寻找的示例?
https://drupal.org/files/ajax-block-working.png https://drupal.org/files/sexy-throbber.png
最佳答案
您应该有一个带有以下 css 代码的 div:
.overlay{background:rgba(0,0,0,0.5);
position:fixed;
z-index:99999;
top:0;
left:0;
}
然后在html中这样写:
<div class="overlay" id="ovly"> </div>
最后在脚本中写道:
//when your ajax is start loading
$("#ovly").show();
请记住,在您的 css 中,除了加载 img 属性之外,不应有任何超过 99999 的 z-index
关于javascript - 如何在 throbber/加载过程中隐藏背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22128180/