Drewster Posted February 12, 2021 Share Posted February 12, 2021 Site URL: https://www.saas-day.com/ Hello everyone! I am currently struggling a bit with a countdown embedded script that just won't show on the page. I am currently using a Harris template from the York family and I would like to have a solution that does not imply to switch off Ajax loading. Here's the code: <center> <h2 id="timer"></h2> </center> <script> var countDownDate = new Date("Mar 11, 2021 09:00:00").getTime();var x = setInterval(function() {var now = new Date().getTime();var distance = countDownDate - now;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);document.getElementById("timer").innerHTML = days + " Tage " + hours + " Std "+ minutes + " Min " + seconds + " Sek ";if (distance < 0) {clearInterval(x);document.getElementById("timer").innerHTML = "";} }, 1000); </script> Thanks a lot for your help! Link to comment
humxahafeex Posted February 12, 2021 Share Posted February 12, 2021 1 hour ago, Drewster said: Site URL: https://www.saas-day.com/ Hello everyone! I am currently struggling a bit with a countdown embedded script that just won't show on the page. I am currently using a Harris template from the York family and I would like to have a solution that does not imply to switch off Ajax loading. Here's the code: <center> <h2 id="timer"></h2> </center> <script> var countDownDate = new Date("Mar 11, 2021 09:00:00").getTime();var x = setInterval(function() {var now = new Date().getTime();var distance = countDownDate - now;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);document.getElementById("timer").innerHTML = days + " Tage " + hours + " Std "+ minutes + " Min " + seconds + " Sek ";if (distance < 0) {clearInterval(x);document.getElementById("timer").innerHTML = "";} }, 1000); </script> Thanks a lot for your help! Hvae you tried using code block instead of embed? Link to comment
Drewster Posted February 12, 2021 Author Share Posted February 12, 2021 Yes, I actually tried with a code block with no success Link to comment
tuanphan Posted February 14, 2021 Share Posted February 14, 2021 Have you solved this yet? Can you share link to page where you added Code Block? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment