overflow: hidden
on the body; instead, toggle it dynamically only when needed, such as during modals.overflow: hidden
instead of the body to control scroll behavior without disabling page scrolling.You're trying to prevent scrolling from being disabled while modifying the body’s overflow in Webflow. This typically happens when setting overflow: hidden
on the body
or html
element unintentionally affects scrolling.
overflow: hidden
on the Bodyoverflow: hidden
on the Body or html
element disables both vertical and horizontal scrolling.overflow: hidden
only when necessary (e.g., when a modal opens).overflow: hidden
on a fixed overlay div, not the body.document.body.style.overflow = 'hidden';
document.body.style.overflow = ''; // or 'auto'
To maintain scrolling while managing overflow
, avoid applying overflow: hidden
to the body unless absolutely needed, and only apply it temporarily during interactions (like modal openings). Use overlays or scoped containers to isolate overflow behavior.