Add a time delay after .show jquery - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:delay

Description

Add a time delay after .show jquery

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-1.7.1.js"></script> 
  <script type="text/javascript">
    $(function(){/*from   w  ww .  j  ava  2 s .c  o  m*/
$("button#one").click(function () {
    $("div#1").show("slow").delay(3000).hide("slow");
});
    });

      </script> 
 </head> 
 <body> 
  <button id="one">click me</button> 
  <div id="1" style="display:none">
    Hello world! 
  </div>  
 </body>
</html>

Related Tutorials