In this guide we will show you how to display count down across all the nodes in your DT. And then additionally redirect out of LeadsHook when the countdown completes.

Here’s the code:

<style>
#minutes, #seconds{
display: inline-block;
background-color: #FF1493;
border-radius: 10px;
color: white;
width: auto;
  min-width:70px;
margin-left: 10px;
padding: 14px;
}
.holder
{
width: 100%;
margin: auto;
text-align: center; 
}
  #minutesTxt, #secondsTxt{
  font-size: 27px;}
</style>

<script>   
var given_seconds = 15; //fifteen seconds
   
setInterval(function() {
 
    // Count down by one second
    given_seconds=given_seconds-1;
     
    // Calculate hour/mins/sec's based on given seconds
    hours = Math.floor(given_seconds / 3600);
    minutes = Math.floor((given_seconds - (hours * 3600)) / 60);
    seconds = given_seconds - (hours * 3600) - (minutes * 60);
    
      // Format the time with two digits per hour/mins/sec's
   
    minutesString = minutes.toString().padStart(2, '0') + '';
    secondsString = seconds.toString().padStart(2, '0') + '';
  
  
    // Print the current time so far
    document.getElementById("minutesTxt").innerHTML = minutesString;
	  document.getElementById("secondsTxt").innerHTML = secondsString;
  
    // Check if countdown is complete & redirect
    if (given_seconds==0)
      window.top.location='https://disney.com';

}, 1000); // Update about every second
</script>

<p>Countdown Demo</p>
<br>

<div class="holder">
  <div id="minutes"><span id="minutesTxt"></span><br>Minutes</div><div id="seconds"><span id="secondsTxt"></span><br>Seconds</div>  
<br><br>
</div>

Simply copy paste the code to the HTML section in your appearance settings.

You can see a working demo here:

https://test2.leadshook.io/survey/z6sgiCqflG9gRYUWeia0auEwiNTJI4k4bjedAi1t

You can download a copy here:

Leave a Reply

Your email address will not be published. Required fields are marked *