title: How to show a running progress bar while page is loading
body: <p>I want to show a running progress bar while my page is loading <a href="http://www.htmldrive.net/items/demo/791/Very-Beautiful-CSS3-And-JQuery-progress-bar" rel="noreferrer">like here</a>, 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:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(window).load(function() {
      alert("hi");
      $('#loading').hide();
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#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;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div id="loading"&gt;
      &lt;img id="loading-image" src="http://cdn.nirmaltv.com/images/generatorphp-thumb.gif" alt="Loading..." /&gt;
  &lt;/div&gt;
  &lt;div id="txt"&gt;
      &lt;h2&gt;Let AJAX change this text&lt;/h2&gt;
  &lt;/div&gt;
  &lt;button&gt;Change Content&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Here is a <a href="http://jsfiddle.net/xM6v9/645/" rel="noreferrer">JSFiddle</a></p>