qsadfasdgfgads

Untitled

Jul 21st, 2019
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     $(document).ready(function() {
  2.    $(".media-block .timer p span").each(function( index, el) {
  3.         if($( this ).text() != '0:00:00:00'){
  4.             var text = $( this ).text();
  5.             var result = text.split(',').map(function (x) {
  6.                 return parseInt(x, 10);
  7.             });
  8.             var countDownDate = new Date(...result);
  9.          
  10.  
  11.             // Update the count down every 1 second
  12.             var x = setInterval(function() {
  13.  
  14.               // Get today's date and time
  15.               var now = new Date().getTime();
  16.  
  17.               // Find the distance between now and the count down date
  18.               var distance = countDownDate - now;
  19.  
  20.               // Time calculations for days, hours, minutes and seconds
  21.               var days = Math.floor(distance / (1000 * 60 * 60 * 24));
  22.               var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  23.               var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
  24.               var seconds = Math.floor((distance % (1000 * 60)) / 1000);
  25.  
  26.               // Display the result in the element with id="demo"
  27.               $( el ).html() = days + "d " + hours + "h "
  28.               + minutes + "m " + seconds + "s ";
  29.  
  30.               // If the count down is finished, write some text
  31.               if (distance < 0) {
  32.                 clearInterval(x);
  33.                 $(this).html() = "EXPIRED";
  34.               }
  35.             }, 1000);
  36.         }
  37.     });
  38.     });
  39.     $(document).ready(function() {
  40.         $('.timetable-accordeon .acc-head').on('click', f_acc);
  41.  
  42.     });
  43.  
  44.     function f_acc() {
  45.         $('.timetable-accordeon .acc-body').not($(this).next()).slideUp(500);
  46.         $(this).next().slideToggle(500);
  47.     }
Advertisement
Add Comment
Please, Sign In to add comment