Countdown Timer in Unbounce

Unbounce is a great marketing platform but when it comes to some important features like a Countdown timer for a limited time offer or coupon, it’s a feature that Unbounce do not provide.

 

But still you can implement a coundown timer without coding knowledge through this post and the code below.

 

I mentioned in my previous post about missing features of Unbounce and shared coding tips to implement an Image slider in Unbounce.

 

I have come up with another solution to implement a countdown timer in Unbounce. You can see the Countdown timer demo here -> Countdown Timer in Unbounce

 

Countdown Timer in Unbounce

1. Create a new page in Unbounce                                                                                                  2. Choose a template or just select a blank template. For now select blank template.

3. In builder. pick “Custom HTML” element and drop it in the page. Then copy and paste the following code.

add custom html in unbounce

You don’t have to change anything in the following  HTML code.

				
					<div>
<h1 id="head"></h1>
<ul>
<li><span id="days"></span>days</li>
<li><span id="hours"></span>Hours</li>
<li><span id="minutes"></span>Minutes</li>
<li><span id="seconds"></span>Seconds</li>
</ul>
</div>
				
			

4. Copy the following JS code and add in a new JS script named “slider”.

Countdown-timer-unbouncehacks

You need to update the date in the JS to the date you want for the countdown timer. Remember You can set it for a specific date.

 

Make sure the placement of the code is changed to ” Before body end tag”.

				
					<script>
const second = 1000,
minute = second * 60,
hour = minute * 60,
day = hour * 24;
let countDown = new Date('OCT 13, 2019 23:59:00').getTime(),  /*Update Date and time in the brackets*/
x = setInterval(function() {
let now = new Date().getTime(),
distance = countDown - now;
document.getElementById('days').innerText = Math.floor(distance / (day)),
document.getElementById('hours').innerText = Math.floor((distance % (day)) / (hour)),
document.getElementById('minutes').innerText = Math.floor((distance % (hour)) / (minute)),
document.getElementById('seconds').innerText = Math.floor((distance % (minute)) / second);
//do something later when date is reached
//if (distance < 0) {
// clearInterval(x);
// 'IT'S MY BIRTHDAY!;
//}
}, second)</script>
				
			

4. Add following CSS in the page. 

You can update any properties based on your preferences. But don’t update the class names. If you update, make sure to update it in HTML as well.

				
					<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
.container {
color: #fff;
text-align: center;
}
h1 {
font-weight: normal;
}

li {
padding-top: 30px;
width: 150px;
height: 150px;
border: 4px solid #000;
/* border-radius: 50%; */
display: inline-block;
font-size: 1.5em;
list-style-type: none;
text-transform: uppercase;
line-height: 1.2;
color: #c4161c;
background-color: #fff;
}
li span {
display: block;
font-size: 48px;
}
@media only screen and (max-width:640px)
{
li span {
display: block;
font-size: 24px;
}
li {
padding:30px;
width:130px;
height:130px;
line-height: 1.2;
}
}
</style>
				
			

That’s it. You should be able to see your countdown timer working on your landing pages now.

 

It’s responsive and works great on mobile devices as well.

 

Found this post helpful? 

Let us know your suggestions and queries in the comment box below. We’ll try to help as soon as possible.

 

More tips and updates related to unbounce here.

Leave a Reply

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

Picture of Sahibjot Singh

Sahibjot Singh

Hey there! I'm Sahibjot Singh, and I've been on an exciting journey as a Web Designer/Developer and Email Automation expert for the past 12 years. It's been a fantastic ride filled with new challenges, and I've learned how to overcome various issues along the way.

One thing that's always been a part of my journey is the need to research and gather different puzzle pieces, using my coding knowledge to piece together solutions for a wide range of problems.

But here's the thing: I've realized that there are many business entrepreneurs and non-technical folks out there who don't have coding skills but often find themselves in similar situations.

So, what makes Unbouncehacks/Unbouncetips special? Well, it's not just a collection of scattered information. I've put together complete end-to-end solutions for the very problems I've encountered and that you might face in the future.

Plus, I keep this website updated with fresh tips and suggestions that have helped me excel in design and email marketing over the years. So, you're in for a treat with a treasure trove of knowledge! 🚀

Share:

Facebook
LinkedIn
Twitter
Skype
WhatsApp

Most Popular

Follow Us

Categories

Doing the best for email marketing? Still your domain can be black listed if you hit a spam trap, once.


Verify your contacts for FREE and make sure there are no spam traps or invalid emails. 

Read More

Related Posts

― Receive the latest articles
Subscribe To Our Newsletter

Get notified about new articles