Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 11th, 2012  |  syntax: None  |  size: 0.52 KB  |  hits: 39  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Rails / Jquery: When loading a page how to see a spinning wheel?
  2. <div id="container" >
  3.     <img src="ajax-loader.gif" alt="Loading" />
  4. </div>
  5.        
  6. <div id="container" >
  7.    Replace image with Page content after fetching data ajax/jquery response
  8. </div>
  9.        
  10. $('#loadingDiv')
  11.     .hide()  
  12.     .ajaxStart(function() {
  13.         $(this).show();
  14.     })
  15.     .ajaxStop(function() {
  16.         $(this).hide();
  17.     })
  18. ;
  19. <div id="loading" style="display:none;">
  20.     Loading Please Wait....
  21.     <img src="ajax-loader.gif" alt="Loading" />
  22. </div>