Webflow sync, pageviews & more.
NEW

How can I disable the dragging and touch swiping behavior in Webflow sliders?

TL;DR
  • Add custom JavaScript to prevent default touchstart and mousedown events on the slider’s mask for disabling swipe and drag.
  • Optionally hide navigation arrows and dots via styling and disable autoplay in the Slider Settings to fully restrict user interaction.

To disable dragging and touch swiping in Webflow sliders, you need to override the default behavior of the slider component using custom code and styling.

1. Disable Swiping with Custom JavaScript

  • Webflow's native slider allows swiping/touch-based navigation on mobile, but this can only be bypassed through JavaScript.

  • Add this code in the Page Settings > Before tag or in Site Settings > Custom Code:

    ```javascript

    ```

  • This script prevents swipe and drag behavior by using event.preventDefault() on both touchstart and mousedown.

  • Make sure your slider's class is w-slider (default). If you added a custom class, adjust the selector accordingly.

2. Prevent Manual Navigation via Arrows or Dots (Optional)

  • If you want to fully restrict user control, you can hide navigation arrows and slides nav dots:
  • Select your slider, then hide the Slider Arrow Left, Slider Arrow Right, and Slider Nav elements using Display: None in the Style panel.

3. Disable Autoplay (Optional)

  • If your goal is to fully freeze the slider, ensure Autoplay is unchecked:
  • Select the Slider element, open Element Settings, then uncheck Autoplay under Slider Settings panel.

Summary

To disable dragging and touch swiping in Webflow sliders, use custom JavaScript that prevents default interaction on the slider's mask container, and optionally hide navigation elements or disable autoplay to further lock interaction.

Rate this answer

Other Webflow Questions