javascript - 更新 : problem showing image while waiting to page to load

标签 javascript jquery html css

我正在尝试显示一张图片,让用户知道在加载某些页面时发生了一些事情。

我尝试了几个在 google 中找到的示例。
我的目标是每次我点击某个链接时,图像应该出现让我知道页面正在加载。但我不能那样做。

到目前为止,我完成的是当我加载该页面时图像出现并且不会消失,但我想在我单击链接时使它可用。

我做了什么:

<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
$("#loading").hide();
});
</script>

<img id="loading" alt="" src="/ajax-loader.gif"/>

#loading {
 width: 100%;
 height: 100%;
 top: 0px;
 left: 0px;
 position: fixed;
 display: block;
 opacity: 0.7;
 background-color: #fff;
 z-index: 99;
 text-align: center;
}

#loading-image {
 position: absolute;
 top: 100px;
 left: 240px;
 z-index: 100;
}

感谢任何帮助:) 谢谢

最佳答案

也许这会有一些帮助:

http://docs.jquery.com/UI/Progressbar

关于javascript - 更新 : problem showing image while waiting to page to load,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3736376/

相关文章:

Javascript背景颜色切换

javascript - React.js 中的 Bootstrap 模式

javascript - Tiny Box POST 表单序列化为数组会导致错误

php - 我怎样才能阻止这个图像移动?

javascript - 在 html 中的选项标签中包含文本框

php - 如何在单击按钮时将数据插入数据库?

jquery - 从所选图像中删除蓝色覆盖/突出显示

javascript - 将 jQuery 添加到 wordpress 页面以显示时间/日期选择器

html - 如何在不弄乱表格结构的情况下自动调整表格的高度?

javascript - 如何防止在没有 "#"的情况下使用 onclick 重新加载?