Some times you just need a simple sticky bar at the top or bottom of your site to promote something, which people can click or dismiss. This is it.
This simple sticky bar will appear for site visitors at the top or bottom of their browser window. If the visitor clicks "X" to dismiss the bar, it will go away and stay away forever.
Ideas for usage:
- Promote upcoming events and webinars.
- Add a prominent call-to-action throughout your site.
- Announce new features, news, or products.
- Greet web visitors obnoxiously.
Pro-tips:
- Change
localStorage
tosessionStorage
and the bar will reappear with each new session, even after being dismissed. - Add the code to a template file to load this bar on every page and for easy editing.
Greg Kogan with help from this tutorial about content gating.