• <legend id='8Fc1R'><style id='8Fc1R'><dir id='8Fc1R'><q id='8Fc1R'></q></dir></style></legend>
  • <i id='8Fc1R'><tr id='8Fc1R'><dt id='8Fc1R'><q id='8Fc1R'><span id='8Fc1R'><b id='8Fc1R'><form id='8Fc1R'><ins id='8Fc1R'></ins><ul id='8Fc1R'></ul><sub id='8Fc1R'></sub></form><legend id='8Fc1R'></legend><bdo id='8Fc1R'><pre id='8Fc1R'><center id='8Fc1R'></center></pre></bdo></b><th id='8Fc1R'></th></span></q></dt></tr></i><div id='8Fc1R'><tfoot id='8Fc1R'></tfoot><dl id='8Fc1R'><fieldset id='8Fc1R'></fieldset></dl></div>

      <tfoot id='8Fc1R'></tfoot>

          <bdo id='8Fc1R'></bdo><ul id='8Fc1R'></ul>
      1. <small id='8Fc1R'></small><noframes id='8Fc1R'>

      2. 如何在页面加载时显示正在运行的进度条

        How to show a running progress bar while page is loading(如何在页面加载时显示正在运行的进度条)
        <legend id='8hrWo'><style id='8hrWo'><dir id='8hrWo'><q id='8hrWo'></q></dir></style></legend>
              <tbody id='8hrWo'></tbody>

          • <tfoot id='8hrWo'></tfoot>

                  <bdo id='8hrWo'></bdo><ul id='8hrWo'></ul>
                • <i id='8hrWo'><tr id='8hrWo'><dt id='8hrWo'><q id='8hrWo'><span id='8hrWo'><b id='8hrWo'><form id='8hrWo'><ins id='8hrWo'></ins><ul id='8hrWo'></ul><sub id='8hrWo'></sub></form><legend id='8hrWo'></legend><bdo id='8hrWo'><pre id='8hrWo'><center id='8hrWo'></center></pre></bdo></b><th id='8hrWo'></th></span></q></dt></tr></i><div id='8hrWo'><tfoot id='8hrWo'></tfoot><dl id='8hrWo'><fieldset id='8hrWo'></fieldset></dl></div>

                  <small id='8hrWo'></small><noframes id='8hrWo'>

                  本文介绍了如何在页面加载时显示正在运行的进度条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想在我的页面加载时显示一个正在运行的进度条 喜欢这里,在我的页面中.我在示例中使用了一个简单的加载图像,但我想将其转换为正在运行的进度条.这是我的代码:

                  I want to show a running progress bar while my page is loading like here, in my page. I used a simple loading image in my example, but I want to convert it in a running progress bar. Here is my code:

                  $(window).load(function() {
                      alert("hi");
                      $('#loading').hide();
                  });

                  #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;
                  }

                  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
                  <div id="loading">
                      <img id="loading-image" src="http://cdn.nirmaltv.com/images/generatorphp-thumb.gif" alt="Loading..." />
                  </div>
                  <div id="txt">
                      <h2>Let AJAX change this text</h2>
                  </div>
                  <button>Change Content</button>

                  这是一个JSFiddle

                  推荐答案

                  我从这个页面.希望这对您有所帮助.

                  I have copied the relevant code below from This page. Hope this might help you.

                  $.ajax({
                    xhr: function() {
                      var xhr = new window.XMLHttpRequest();
                      //Upload progress
                      xhr.upload.addEventListener("progress", function(evt) {
                        if (evt.lengthComputable) {
                          var percentComplete = evt.loaded / evt.total;
                          //Do something with upload progress
                          console.log(percentComplete);
                        }
                      }, false);
                      //Download progress
                      xhr.addEventListener("progress", function(evt) {
                        if (evt.lengthComputable) {
                          var percentComplete = evt.loaded / evt.total;
                          //Do something with download progress
                          console.log(percentComplete);
                        }
                      }, false);
                      return xhr;
                    },
                    type: 'POST',
                    url: "/",
                    data: {},
                    success: function(data) {
                      //Do something success-ish
                    }
                  });
                  

                  这篇关于如何在页面加载时显示正在运行的进度条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Draw border around nontransparent part of image on canvas(在画布上的图像不透明部分周围绘制边框)
                  dragging and resizing an image on html5 canvas(在 html5 画布上拖动图像并调整其大小)
                  What#39;s the difference between a boolean as primitive and a boolean as property of an object?(作为原始对象的布尔值和作为对象属性的布尔值有什么区别?)
                  I want to do animation of an object along a particular path(我想沿特定路径对对象进行动画处理)
                  How to upload image into HTML5 canvas(如何将图像上传到 HTML5 画布中)
                  HTML5 Canvas camera/viewport - how to actually do it?(HTML5 Canvas 相机/视口 - 如何实际做到这一点?)
                  <i id='q7hBA'><tr id='q7hBA'><dt id='q7hBA'><q id='q7hBA'><span id='q7hBA'><b id='q7hBA'><form id='q7hBA'><ins id='q7hBA'></ins><ul id='q7hBA'></ul><sub id='q7hBA'></sub></form><legend id='q7hBA'></legend><bdo id='q7hBA'><pre id='q7hBA'><center id='q7hBA'></center></pre></bdo></b><th id='q7hBA'></th></span></q></dt></tr></i><div id='q7hBA'><tfoot id='q7hBA'></tfoot><dl id='q7hBA'><fieldset id='q7hBA'></fieldset></dl></div>
                  <legend id='q7hBA'><style id='q7hBA'><dir id='q7hBA'><q id='q7hBA'></q></dir></style></legend>
                  <tfoot id='q7hBA'></tfoot>

                  • <bdo id='q7hBA'></bdo><ul id='q7hBA'></ul>

                        • <small id='q7hBA'></small><noframes id='q7hBA'>

                            <tbody id='q7hBA'></tbody>