How to Control a Banner’s Display and Dismissal Using the Browser’s Local Storage in Webflow
Introduction
In this tutorial, Sandro, cofounder of the Gemeos Webflow agency, shows you how to control when a banner appears and closes using the browser's local storage in Webflow.
Controlling when a promotional banner appears and closes using the browser's local storage improves the user experience. This technique keeps the banner from showing up on every visit, reducing interruptions and distractions for the user.
Here's how to do it:
1. Add the "banner" ID to your banner

2. Add the "close-btn" class to the element that closes your banner

3. Hide your banner by default
Your banner should be set to Display: None by default

4. Add this code to the <body> of your page
5. All that's left is to test it

Lorem ipsum
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.











.avif)




