Add

Lorem ipsum

Lorem ipsum

A
A
A
CRO / Conversion

1 views

4 min

How to Create an Exit-Intent Popup in Webflow

Learn how to create an exit-intent popup in Webflow: mouse detection, mobile scroll, and display frequency.

In this tutorial, Sandro, co-founder of Gemeos Webflow agency, shows you how to display an exit-intent popup in Webflow: it appears when the visitor is about to leave the page.

Example

Move your mouse up and off the page to trigger it

Waiting for the exit signal...
⚡ Limited offer

Wait before you go!

Download our free checklist: 20 points to audit your Webflow website in 30 minutes.

TriggerDeviceCondition
Mouse upDesktope.clientY <= 0
Fast upward scrollMobileDelta > 50px upward
sessionStorageAllShown only once per session

1. Create the popup in Webflow

Create a Div with the ID exit-popup set to Fixed position, covering the entire page (top/left/right/bottom: 0), background rgba(0,0,0,0.5), display flex, align-items and justify-content center. Inside it, add your modal with your offer. Set the overlay to display: none by default. Add the exit-popup-close class to the close button.

2. Add the script in Footer code

(function() {
var shown = sessionStorage.getItem('exit-shown');
if (shown) return;

var overlay = document.getElementById('exit-popup');
if (!overlay) return;

function show() {
if (sessionStorage.getItem('exit-shown')) return;
overlay.style.display = 'flex';
sessionStorage.setItem('exit-shown', '1');
}

function close() {
overlay.style.display = 'none';
}

// Desktop: mouse leaving upward
document.addEventListener('mouseleave', function(e) {
if (e.clientY <= 0) show();
});

// Mobile: fast upward scroll (intent to leave)
var lastScroll = window.scrollY;
window.addEventListener('scroll', function() {
var delta = lastScroll - window.scrollY;
if (delta > 50 && window.scrollY < 200) show();
lastScroll = window.scrollY;
});

// Close
overlay.addEventListener('click', function(e) {
if (e.target === overlay) close();
});
document.querySelectorAll('.exit-popup-close').forEach(function(btn) {
btn.addEventListener('click', close);
});
document.addEventListener('keydown', function(e) {
if (e.key === 'Escape') close();
});
})();

3. Customize the trigger

To trigger it only after X seconds on the page, add a minimum delay before activating the listeners:

// Activate exit intent only after 30 seconds
var ready = false;
setTimeout(function() { ready = true; }, 30000);
document.addEventListener('mouseleave', function(e) {
if (ready && e.clientY <= 0) show();
});

good to know

sessionStorage.setItem('exit-shown', '1') prevents the popup from appearing multiple times in the same browsing session. If you want it to show again on every visit (not just every session), replace sessionStorage with a simple variable: var shown = false. For an in-between display frequency, use localStorage with an expiration date.

Conclusion

Exit intent is one of the most effective lead recovery tools. Use cases:

  • Last-chance offer on a pricing page
  • Download a free guide before leaving
  • Newsletter signup with an incentive

Move your mouse to the top of the page to trigger the popup

👀Waiting for the exit signal...

Wait!

Before you go, download our free guide to Webflow optimization.

Download the guideNo thanks, I’m leaving

Good to know

Heading

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

Lorem ipsum dolor sit amet consectetur.

Lorem ipsum dolor sit amet consectetur. Aliquam orci sagittis dignissim sapien praesent donec.

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.

Published on

You might be interested in these tutorials

Similar tutorials

SEO / GEO

5 min read

5 views

How to Set Up a Redirect in Webflow? (2026)

Updated on 19.12.2025 by Sandro DA SILVA

SEO / GEO

5 min read

5 views

Add structured data to your Webflow site?

Updated on 21.08.2025 by Sandro DA SILVA

No-code

5 min read

5 views

How to Obfuscate a Link in Webflow

Updated on 23.04.2025 by Sandro DA SILVA

Let’s f*****G GO !!

Ready to launch
Your business?

Alexandre

Max

Enora

Bryan

Cannelle

Tiphaine

You'll :heart: our collaboration...