Search code examples
jqueryloaddelaywait

jQuery - "Loading, Please Wait" On certain Div


I'm rather new to jQuery, and I'm not too sure which direction to take on this, but I'd like to have some sort of jQuery or Javascript where I can go in, and have a .delay() function of about 3 seconds meanwhile it displays "Please Wait" then shows the div contents. I'm sorry I have no code to show, I only can describe the theory. =/

Thank you for any help provided - Necro


Solution

  • <div id="mydiv">
    
      <span id="loading">Loading...</span>
    
      <span id="content" style="display:none;">Bla bla bla</span>
    
    </div>
    
    <script>
    setTimeout(function(){
    
      $("#loading").hide(100); //100 = animation speed in miliseconds
      $("#content").show(100);
    
    }, 3000); //3000 miliseconds = 3 seconds
    </script>
    

    Example: http://jsfiddle.net/dbdAx/