Add

Lorem ipsum

Lorem ipsum

A
A
A
Design

3 views

3 min

How to Detect Fast Scrolling in Webflow and Trigger an Animation

Learn how to detect a fast scroll in Webflow and trigger an animation or a surprise message.

In this tutorial, Sandro, cofounder of the Gemeos Webflow agency, shows you how to trigger an animation when a user scrolls the page really fast in Webflow.

ParameterValueDescription
THRESHOLD80Speed in px/frame to trigger the effect
toastShownfalsePrevents repeated triggers

The script

(function() {
var style = document.createElement('style');
style.textContent = '@keyframes slideDown { from{opacity:0;transform:translateY(-10px)} to{opacity:1;transform:translateY(0)} }';
document.head.appendChild(style);
var lastScroll = 0, lastTime = Date.now(), toastShown = false;
var THRESHOLD = 80;
window.addEventListener('scroll', function() {
var now = Date.now();
var delta = Math.abs(window.scrollY - lastScroll);
var timeDiff = now - lastTime || 1;
var speed = delta / timeDiff * 16;
if (speed > THRESHOLD && !toastShown) {
toastShown = true;
var toast = document.createElement('div');
toast.textContent = '🚀 Woah, you’re scrolling fast!';
toast.style.cssText = 'position:fixed;top:24px;right:24px;background:#a78bfa;color:#fff;padding:10px 20px;border-radius:100px;font-size:14px;z-index:9999;animation:slideDown 0.3s ease;';
document.body.appendChild(toast);
setTimeout(function() { toast.remove(); toastShown = false; }, 2000);
}
lastScroll = window.scrollY;
lastTime = now;
});
})();

good to know

For a less intrusive version, just add a CSS class to the body: document.body.classList.toggle('is-fast-scrolling', speed > THRESHOLD). Then style .is-fast-scrolling to adapt the design.

Conclusion

A clever little easter egg that rewards bold explorers. Scroll fast to test the effect.

interactive example

Scroll very quickly on this page to trigger the message

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...