Drewster 2 Share Posted February 12 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 post
0 humxahafeex 54 Share Posted February 12 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 post
0 Drewster 2 Author Share Posted February 12 Yes, I actually tried with a code block with no success Link to post
0 tuanphan 9,609 Share Posted February 14 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 :-D). Answer within 24 hours. How to: Setup password & share url Insert Custom CSS Open Page Header Upload Custom Font Find Block ID, Data Section ID Contact Squarespace Customer Care -- Yup! Link to post
Question
Drewster 2
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 post
Top Posters For This Question
2
1
1
Popular Days
Feb 12
3
Feb 14
1
Top Posters For This Question
Drewster 2 posts
humxahafeex 1 post
tuanphan 1 post
Popular Days
Feb 12 2021
3 posts
Feb 14 2021
1 post
3 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment