title: showing loading gif file while page gets loaded using jquery
body: <p>I am using JQuery.</p>
  
  <p>I am having below jquery which I am using to show the page fragment, it load the page fragment while the main page is loading.</p>
  
  <pre><code>$(document).ready(function() 
  {
          $(".load-fragment").each(function()         
          {          
              var $objThis = $(this);
              var fname = $objThis.attr("href");
              var dynDivID = "divContent"+ $objThis.attr("id"); 
              var newDiv = $("&lt;div&gt;").attr("id",dynDivID).load(fname + " #tabs-container",function ()
              {               
                  $(this).hide(); //Hiding all the newly created DIVs
  
              });          
              newDiv.addClass('dynDiv');  //Adding CSS to newly created Dynamic Divs 
  
              $("#column2").append(newDiv); //adding new div in div column2 
          });    
  
          $(".load-fragment").click(function() 
          {
              // load page on click  
              var $thiz = $(this); //making the current object   
              $thiz.attr("href", "#");         
              $(".tabs-nav li").removeClass("tabs-selected"); //removing the css from the li
              $thiz.parent().addClass("tabs-selected"); //adding the selected class to the parent on click
              $("#tabs-container").hide(); //playing with hide and show
              $('.dynDiv').hide();
              $("#divContent" + $thiz.attr("id")).show();  
          });     
  }); 
  </code></pre>
  
  <p>Now I want to show the loading.gif while jquery loads the page. Below is the code taken from above jquery where I am trying to load page.</p>
  
  <pre><code>var newDiv = $("&lt;div&gt;").attr("id",dynDivID).load(fname + " #tabs-container",function ()
                  {               
                      $(this).hide(); //Hiding all the newly created DIVs
  
                  }); 
  </code></pre>
  
  <p>Please suggest as it is taking sometime to load the page fragment.</p>
  
  <p>Thanks.</p>
  
  <p>Best Regards,
  MS</p>