加载gif图像显示另一帧。使用jquery

时间:2017-03-31 07:04:34

标签: javascript jquery html css image

enter image description here

请看上面的html框架。

如果我点击[菜单]框中的菜单,

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

但gif图像仅显示[菜单]框架......



$("#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>
&#13;
&#13;
&#13;

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

如何显示anohter页面??

我已经使用了post,load function ...

1 个答案:

答案 0 :(得分:0)

请检查以下代码,我猜您的问题将被清除。

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