All things Shopify and commerce
Hello All
I am using Shopify Theme Dawn and I am trying to add a link to my announcement bar so when customers click on it, it scrolls all the way to the bottom of the page so customers can sign up. Or it re opens my Newsletter sign up 'pop up'.
Can anyway help advise I can do this?
Thank you
Hello,
May I have your store url please?
Hi @IndujaAIKY,
You can try this code by following these steps:
Step 1: Go to Online Store->Theme->Edit code.
Step 2: Search file theme.liquid
Step 3: Paste the below code at bottom of the file -> Save
<script>
window.addEventListener('DOMContentLoaded',(event)=>{
document.querySelector('.announcement-bar__message').onclick=()=>{
window.scrollTo({
top: document.documentElement.scrollHeight,
behavior: 'smooth' // Adds a smooth scrolling effect
});
}
});
</script>
Hope my solution works perfectly for you!
Best regards,
Victor | PageFly
Is there a way to click on the announcement and it shows the pop up to sign up to newsletter?
the solution above will allow you to click the announcement and takes to you the bottom of the page where email sign up shows. How about clicking the announcement and displaying the pop up box?
Works perfectly, except that the cursor doesn't change to the pointer. It has the text icon. Would you add that to the script for us please?
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025