Jump to content

Custom Code for Countdown Clock

Recommended Posts

Site URL: https://hwy61roadhouse.squarespace.com/

Does anyone know why I can't get the countdown clock to work on my website: https://hwy61roadhouse.squarespace.com/

Here is the code I inserted, but It doesn't seem to be working when I view the website logged out and in incognito mode?

I am using the code that was suggested on https://insidethesquare.co/countdown (see below). Has anyone else used it? 

<style>#countdown{color:#fff; display:inline-block; text-align:center; font-size:1.5rem}
#countdown>div{padding:10px; background:#0e8ba9; display:inline-block}
#countdown div>span{padding: 5px; display:inline-block} </style><center><div
id="countdown"><div><span class="days" id="day"></span><div
class="text">Days</div> </div> <div><span class="hours" id="hour"></span> <div
class="text">Hours</div> </div> <div><span class="minutes" id="minute"></span> <div
class="text"> Minutes</div></div><div><span class="seconds" id="second">
</span><div class="text">Seconds</div></div></div> <p
id="timer"></p></center><script>var deadline=new Date("feb 18, 2023
12:00:00").getTime();var x=setInterval(function(){var now=new Date().getTime();var
t=deadline-now; var days=Math.floor(t/(1000*60*60*24)); var
hours=Math.floor((t%(1000*60*60*24))/(1000*60*60)); var
minutes=Math.floor((t%(1000*60*60))/(1000*60)); var
document.getElementById("second").innerHTML='0'}},1000); </script>



Link to comment
  • Replies 1
  • Views 194
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

There are a bunch of syntax errors in the code because of newlines in unexpected places.

Either the source is badly formatted or something happened when you copy and pasted.

I tried to check the source but am not interesting in getting on a mailing list.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.