D_Roca Posted April 26, 2021 Posted April 26, 2021 Site URL: http://savingmyanmar.com Put together a teaser landing page for our site launch with a countdown timer. Everything seems to function properly when viewing the desktop version AND when testing the mobile version on Desktop, but once I pull up the page on my actual mobile device, the numbers all display NAND NANH NANM NANS. I understand that that stands for Not Available Number Day, .... Hours..... Minutes.... Seconds.... Here is my code. Can anyone help? Quote <html> <h2> <head> <style> body { text-align: center; } </style> </head> <body> <p id="demo"></p> <script> // Set the date we're counting down to var countDownDate = new Date("05/01/2021 24:00:00").getTime(); // Update the count down every 1 second var x = setInterval(function() { // Get today's date and time var now = new Date().getTime(); // Find the distance between now and the count down date var distance = countDownDate - now; // Time calculations for days, hours, minutes and seconds var days = Math.floor(distance / (1000 * 60 * 60 * 24)); var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); var seconds = Math.floor((distance % (1000 * 60)) / 1000); // Output the result in an element with id="demo" document.getElementById("demo").innerHTML = days + "d " + hours + "h " + minutes + "m " + seconds + "s "; // If the count down is over, write some text if (distance < 0) { clearInterval(x); document.getElementById("demo").innerHTML = "IT'S TIME!"; } }, 1000); </script> </body> </h2> </html>
tuanphan Posted April 26, 2021 Posted April 26, 2021 Which mobile/browser do you use? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
D_Roca Posted April 26, 2021 Author Posted April 26, 2021 Chrome. But i've also tried it on Safari and its bugging up the same way in that browswer
D_Roca Posted April 28, 2021 Author Posted April 28, 2021 Chrome. But i've also tried it on Safari and its bugging up the same way in that browswer @tuanphan
Recommended Posts
Archived
This topic is now archived and is closed to further replies.