Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="it">
- <head>
- <title>HTML5 & CSS & jQuery: countdown</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
- <script>
- var d = new Date();
- var n = d.getDay();
- if(n == 1 || 2 || 3 || 4 || 5){
- var timer;
- function cdtd() {
- var data = new Date();
- var arrivo = new Date(data.getFullYear(),data.getMonth(),data.getDate(),23,30,00);
- var timeDeff = arrivo.getTime() - data.getTime();
- if (timeDeff <= 0) {
- clearInterval(timer);
- document.getElementById(id).innerHTML = '';
- }
- var secondi = Math.floor(timeDeff / 1000);
- var minuti = Math.floor(secondi / 60);
- var ore = Math.floor(minuti / 60);
- var giorni = Math.floor(ore / 24);
- ore %= 24;
- minuti %= 60;
- secondi %= 60;
- $("#giorniBox").html(giorni);
- $("#oreBox").html(ore);
- $("#minutiBox").html(minuti);
- $("#secondiBox").html(secondi);
- timer = setTimeout(cdtd, 1000);
- }
- $(document).ready(function() {
- cdtd();
- });
- }
- </script>
- <style type="text/css">
- body {
- background-color: black;
- }
- #giorniBox{
- font-size:70px;
- color:#1f62a7;
- font-family:Sans-serif;
- display: inline-block;
- }
- #oreBox{
- font-size:70px;
- color:#1f62a7;
- font-family:Sans-serif;
- display: inline-block;
- }
- #minutiBox{
- font-size:70px;
- color:#1f62a7;
- font-family:Sans-serif;
- display: inline-block;
- }
- #secondiBox{
- font-size:70px;
- color:#1f62a7;
- font-family:Sans-serif;
- display: inline-block;
- }
- h1{
- font-size:70px;
- color:#1f62a7;
- font-family:Sans-serif;
- display: inline-block;
- }
- </style>
- </head>
- <body>
- <center>
- <h1>LA GIORNATA FINIRΓ TRA:</h1><br />
- <header id="oreBox"></header>
- <h1>:</h1>
- <header id="minutiBox"></header>
- <h1>:</h1>
- <header id="secondiBox"></header>
- </center>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement