Advertisement
ryuusoultaker

multiple time counter

Nov 20th, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.72 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.         <!-- Our CSS stylesheet file -->
  5.         <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300" />
  6.         <link rel="stylesheet" href="assets/css/styles.css" />
  7.         <link rel="stylesheet" href="assets/countdown/jquery.countdown.css" />
  8.         <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
  9.         <script src="assets/countdown/jquery.countdown.js"></script>
  10.        
  11.         <!--[if lt IE 9]>
  12.          <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  13.        <![endif]-->
  14.     </head>
  15.    
  16.     <body>
  17.        
  18.  
  19.         <br>
  20.         <table border="0"><tr><td>
  21.         <div class="countdown"></div>
  22.         <p class="note" data-ts="2014, 11-1, 25, 10, 0, 0"></p>    
  23.         </td></tr></table>
  24.        
  25.         <!-- JavaScript includes -->
  26.        
  27.         <script type="text/javascript">
  28.        
  29.    
  30.              $(function(){
  31.  
  32.         $('.countdown').each(function() {
  33.             var $this = $(this),
  34.                 ts = new Date($this.data('ts')),
  35.                 newYear = new Date() > ts;
  36.             $this.countdown({
  37.                 timestamp   : ts,
  38.                 callback    : function(days, hours, minutes, seconds){
  39.                     var message = "";
  40.                     message += days + " hari" + ( days==1 ? '':'' ) + ", ";
  41.                     message += hours + " jam" + ( hours==1 ? '':'' ) + ", ";
  42.                     message += minutes + " menit" + ( minutes==1 ? '':'' ) + ", ";
  43.                     message += seconds + " detik" + ( seconds==1 ? '':'' ) + " <br />";
  44.                     $this.next().html(message);
  45.                 }
  46.             });
  47.         });
  48.  
  49.     });
  50.    
  51.    
  52.  
  53.     </script>
  54.    
  55.     </body>
  56.    
  57. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement