Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
These snippets completely disable the smooth-scroll animation that is present on all Webflow sites. Animated scrolling can disorient or surprise users, or even cause motion sickness!
// Disable smooth scrolling for users who have set `prefers-reduced-motion` in their operating system
// 1. Place this snippet before the end of the <body> tag;
// NOT in the <head> tag!
// 2.Make sure it's inside $(function() {})!
$(function() {
const mediaQuery = window.matchMedia('(prefers-reduced-motion: reduce)');
if (mediaQuery.matches) $(document).off('click.wf-scroll');
})
// Disable smooth scrolling for ALL users
// 1. Place this snippet before the end of the <body> tag;
// NOT in the <head> tag!
// 2. Make sure it's inside $(function() {})!
$(function() {
$(document).off('click.wf-scroll');
})
@chaseadamsio

This comment has been minimized.

Copy link

@chaseadamsio chaseadamsio commented Jan 15, 2021

Thanks for this @mxmason!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment