Advertisement
niammuddin

membuat timer dengan jquery

Sep 21st, 2018
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.74 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title></title>
  5. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script>
  6. <script type="text/javascript">
  7. jQuery(document).ready(function() {
  8. var sec = 10
  9. var timer = setInterval(function() {
  10.    $("#mdtimer span").text(sec--);
  11.    if (sec == 0) {
  12. $("#makingdifferenttimer").delay(1000).fadeIn(1000);
  13. $("#mdtimer").hide(1000) .fadeOut(fast);}
  14. },1000);
  15. });
  16. </script>
  17.  
  18. </head>
  19. <body>
  20.  
  21.  
  22.  
  23.  
  24. <center>
  25.  
  26. <div id="makingdifferenttimer" style="display: none;">
  27. <h1>Tampilan setelah loading timer</h1>
  28. </div>
  29.  
  30. <div id="mdtimer">
  31. <h1>Tampilan saat loading timer</h1>
  32. <b>Please Wait <span>10</span> seconds</b>
  33. </div>
  34.  
  35. </center>
  36.  
  37.  
  38.  
  39. </body>
  40. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement