【问题标题】:loading gif image display another frame. use jquery加载 gif 图像显示另一帧。使用 jQuery
【发布时间】:2017-03-31 07:04:33
【问题描述】:

请看上面的html框架。

如果我点击 [Menu] 框架上的菜单,

然后加载gif图像将显示[加载页面]框架。

但 gif 图像只显示 [Menu] 框架......

$("#mmeload").click(function() {
  $('#loader').show();
  $setTimeout(function() {
    $('#loader').hide();
  }, 6500);
});
.loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, .8)url('/images/default.gif') no-repeat 50%
}
<!DOCTYPE html>
<html>

<head>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
</head>

<body>
  <div class="dTree">
    <div class="loader" id="loader" style="display:none"></div>
    <a href="setup/mmeContextView.php" id="mmeload" target="view">MME Info</a>
  </div>
</body>

</html>

如果点击菜单,则显示gif图像,并在6500微秒后隐藏..

如何显示另一个页面...?

我已经用过post、load功能了……

【问题讨论】:

  • 您的“框架”是指 html
  • 我认为你的 CSS 必须包含 'z-index' 属性。
  • $setTimeout 中删除$setTimeout() 不需要$
  • LIXer ,而不是 iframe。框架文件与其他文件分离....

标签: javascript jquery html css image


【解决方案1】:

请检查以下代码,我想您的问题将得到解决。

$("#mmeload").click(function() {
  $('#loader').show();
  setTimeout(function() {
    $('#loader').hide();
  }, 6500);
});
.loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, .8)url('/images/default.gif') no-repeat 50%
}
<!DOCTYPE html>
<html>

<head>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
</head>

<body>
  <div class="dTree">
    <div class="loader" id="loader" style="display:none"></div>
    <a href="setup/mmeContextView.php" id="mmeload" target="view">MME Info</a>
  </div>
</body>

</html>

【讨论】:

    猜你喜欢
    • 2011-03-06
    • 2014-04-10
    • 2012-06-05
    • 2015-06-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多