I’d love to swap between 2 different sticky bar messages, one for weekdays and one for weekends WITHOUT having to manually reset the scheduling dates every week. Does anyone know if there a way to do this?
Page 1 / 1
Hi Melissa!
As far as I know, the only scheduling we can do with stickybars is to input a start date and end date. This would be great feedback for our feature request form if you have a moment.
Curious to see if other community members have found a workaround for this? I’ll keep my eyes peeled 🍌
Take care,
-Jess
Hey @Melissa, custom script coming at you!
If you could select your special offer text and give it a class of “dynamic-offer”:
… then add this javascript (“before body end tag”)…
<script type="text/javascript">
// Identify the span within your "dynamic-offer" class
const dynamicOfferText = document.querySelectorAll(".dynamic-offer span")o0];
// Get the day of the week
const dayOfWeek = new Date().getDay();
// If the day of week is bigger than 5 (i.e. is 6 or 7), set it to weekend offer
if(dayOfWeek > 5) {
dynamicOfferText.innerText = "My very special WEEKEND offer";
} else {
dynamicOfferText.innerText = "My very special WEEKDAY offer";
}
</script>
… that’ll dynamically replace the text based on the day of week!
Reply
Log in to the Unbounce Community
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.