【问题标题】:update: problem showing image while waiting to page to load更新:等待页面加载时显示图像的问题
【发布时间】:2010-09-20 22:08:53
【问题描述】:

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

我尝试了几个在 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;
}

感谢您的帮助:) 谢谢

【问题讨论】:

    标签: javascript jquery html css


    【解决方案1】:

    也许这会有所帮助:

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

    【讨论】:

    • 我已经看过那个了,但它是静态的。我想要一些会随着时间而进步的东西。
    【解决方案2】:

    这是一个简单的:http://www.webappers.com/progressBar/

    这是我在 google 中输入“js 进度条”时的第一个结果——还有数百个。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-08-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多