Dismissible Elements

Automatically suppress your Webflow modals, popups & more after the user closes them, for a specified number of days.

This feature enables you to easily "close" and suppress UI elements so that they will not appear for a specified number of days, even on page reload.

It's primarily used for;

  • Alert banners

  • Notices

  • Interactions ( IX2 )-based modals & pop-ups

But can be used for any elements that you want to suppress.

Demonstration

Demo Page
Cloneable

Use Cases

  • Suppress a notification banner

  • Suppress an interactions-based modal popup

  • Suppress a CTA or special offer

Usage Notes

This library simplifies dismissable elements into two parts-

  1. The dismissable element itself, which can be any popup, DIV, or other element

  2. Close button element(s), such as a corner "X" or a "Close" button. These must be positioned within the dismissable element as descendants.

To implement this, design your elements, alerts, modals or CTAs however you like.

The close functionality will be an element with a special custom attribute on it. When closed, SA5 will remove the element from the DOM, and suppress it for as long as you've requested.

Getting Started

Once your elements are setup as described in Usage Notes, you can apply the attributes.

STEP 1 - Add the Library

First, add the library as detailed in Quick Start.

To the outermost element you want to suppress;

  • Add a custom attribute of wfu-dismiss = ( name ). Give it any custom name you like. That name will be used in the suppression tracking so you can e.g. have the same modal on every page, and suppress it site-wide.

  • Add a custom attribute of wfu-dismiss-trigger = load.

  • Add the suppression duration you want, using wfu-dismiss-suppress-days = ( days ).

To the close element(s) within the dismissible element;

  • Add an attribute of wfu-dismiss-close = true

  • Add an attribute of wfu-dismiss-close-type = auto

Best Practices

Preload

Dismissible elements also support Preload. This allows you to hide an element completely with CSS before the script runs, and before its dismiss state is determined.

e.g. You can add this on the element with wfu-dismiss .

wfu-preload = hidden

Technical Notes

We're currently using a cookie for the suppression, so that it automatically expires.

This can be easily deleted through your browser's devtools if you choose, during testing.

Future

wfu-dismiss-action = open | close

wfu-dismiss-action-method = auto | interaction

wfu-dismiss-action-trigger = click | timer | scroll | exit

wfu-dismiss-action-trigger-ms = 10000

Questions? Feature Requests?

Visit the SA5 forum link at the top of this page.

Last updated

Was this helpful?