Jump to content

DonnaST

Member
  • Posts

    8
  • Joined

  • Last visited

Reputation Activity

  1. Love
    DonnaST reacted to paul2009 in Countdown timer code not working - help please?   
    You cannot simply duplicate the block of code because each block requires unique variables and IDs. (IDs must be unique on the page.)
    However:
    If the timers are counting down to the same point in time, you can leave the 'deadline' variable the same. You won't need to duplicate this line of code. The classes can remain the same if you want them to have the same colours. You also won't need to duplicate the content that starts with <style> and ends with </style>. To create the second countdown, make a copy of the working code from the first and then change each variable name (var) and each ID in the HTML and the JavaScript.
    For example, the HTML section of the first countdown element starts with:
    <div id="countdown"> <div> <span class="days" id="day"> </span> In the second countdown, you could add '2' to make the IDs different to the first countdown:
    <div id="countdown2">   <div>     <span class="days" id="day2">     </span> You'll need to do this throughout.
×
×
  • 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.