Skip to content

CRO / Conversion4 min read

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.

(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();
});

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

Published on May 20, 2026

Sandro DA SILVA

Growth Marketer, Webflow expert, and jack-of-all-trades. Sandro handles commercial operations, ensures projects run smoothly, and addresses marketing-related issues (SEO, Tracking, Copywriting, etc).

You might be interested in these tutorials

Related tutorials

See all

You're going to working with us, guaranteed

Ready to launch your business?

get a quote

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