Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. <script> CountDownTimer('02/22/2018 05:00 PM', 'newcountdown'); function CountDownTimer(dt, id) { var end = new Date(dt); var _second = 1000; var _minute = _second * 60; var _hour = _minute * 60; var _day = _hour * 24; var timer; function showRemaining() { var now = new Date(); var distance = end - now; if (distance < 0) { clearInterval(timer); document.getElementById(id).innerHTML = '<div style="position:relative;left:83pt;margin-top:-14px;">FINALIZADA!</div><div style="clear:both;"></div>'; return; } var days = Math.floor(distance / _day); var hours = Math.floor((distance % _day) / _hour); var minutes = Math.floor((distance % _hour) / _minute); var seconds = Math.floor((distance % _minute) / _second); document.getElementById(id).innerHTML = '<div style="position:relative;left:0pt;margin-top:-14px;"><span style="color:orange;">' + days + '</span></div><div style="clear:both;"></div>'; document.getElementById(id).innerHTML += '<div style="position:relative;left:50pt;margin-top:-14px;">' + hours + '</div><div style="clear:both;"></div>'; document.getElementById(id).innerHTML += '<div style="position:relative;left:100pt;margin-top:-14px;">' + minutes + '</div><div style="clear:both;"></div>'; document.getElementById(id).innerHTML += '<div style="position:relative;left:150pt;margin-top:-14px;">' + seconds + '</div><div style="clear:both;"></div>'; } timer = setInterval(showRemaining, 1000); } </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement