Block Scroll on Modal Open

0
1

Enhance user focus with Webflow scroll control cloneable by Alex Iglesias Piñol. Effortlessly manage scrolling behavior on webpages to optimize user engagement. Easily integrate custom code for precise scroll control, toggling between states for a seamless user experience.

Categories

js library

No items found.
About cloneable

This Webflow cloneable, created by Alex Iglesias Piñol, is a powerful tool designed to easily control scrolling behavior on a webpage in response to user interactions. It addresses a common need for web designers and developers—preventing users from scrolling when a modal or specific event is activated, thereby enhancing user focus and engagement.

By implementing this cloneable, Webflow users can effortlessly manage scroll functionality through simple code integration. The provided JavaScript allows developers to assign attributes like scroll="disable" or scroll="enable" to various elements. This offers precise control: disabling background scrolling when a modal is displayed and re-enabling it upon user action. The versatility of the scroll="both" attribute also allows for toggling between states, offering a seamless user experience.

Setting this up is straightforward—users merely need to copy the custom code into their project and apply the relevant attributes to their trigger elements. Additionally, modifying the overflow property of modal containers ensures that internal scrolling is still possible when the content exceeds the viewport height.

This cloneable not only optimizes the overall user experience by reducing distractions but also helps in maintaining the user's attention on the critical elements present in modals or popups. By incorporating this functionality, Webflow users can create well-structured, interactive designs that guide user actions effectively, ultimately leading to improved engagement and usability on their websites.

About custom code
About CSS

What does the CSS code related to .dummy-text class do in Webflow?

The CSS code for the .dummy-text class sets the writing mode to vertical-rl, which means that the text will be displayed vertically from right to left. The text-orientation property is set to upright, ensuring that the individual letters within the vertical text are oriented in a standard horizontal manner. This is particularly useful in layouts where vertical text is needed, such as banners or certain design elements in Webflow.

About Javascript

What does the brota-disable-scroll JavaScript file do in a Webflow project?

The brota-disable-scroll script is designed to help manage scrolling behavior on the website. Specifically, it provides functions to disable or enable scrolling on the page, which is particularly useful during modal displays or when user interaction is needed without background scrolling. By including this in a Webflow project, developers can manage user experience more effectively.

How does the Webflow-specific JavaScript code enhance scrolling capabilities?

The Webflow-specific JavaScript code provided controls the scroll behavior based on user interactions with specific elements (marked with attributes scroll="disable", scroll="enable", scroll="both"). It allows developers to disable the page scrolling when a modal or overlay is active, preventing background scrolling, and re-enabling it when needed. This improves user experience by ensuring focus on specific content.

What happens when a user clicks elements with scroll="disable", scroll="enable", or scroll="both" attributes in Webflow?

Clicking an element with scroll="disable" will freeze the scroll position of the document, effectively preventing any scrolling until the user clicks an element with scroll="enable" to revert this effect. The scroll="both" attribute serves a dual purpose; it will disable scrolling if it is currently enabled or enable it back if it is already disabled, toggling the state based on the existing condition. This allows for dynamic control over scroll behavior in Webflow projects.

How do CSS properties manage scrolling behavior in the provided Webflow JavaScript code?

The provided JavaScript code modifies several CSS properties of the body element to manage scrolling. When scrolling is disabled, it sets the body’s overflow to hidden, fixes its position, and adjusts the top property to capture the current scroll position. When scrolling is enabled, it resets the overflow, position, and top properties to restore normal scrolling behavior. This manipulation ensures that the page essentially "locks" during certain interactions, preventing distractions from the background.

Embed badge
similar cloneables
New
CMS Horizontal scroll animation Webflow cloneable.
Explore a captivating CMS-based Horizontal Scroll Animation Webflow cloneable by Pierre de Montalte. This design offers a visually engaging experience for showcasing products, articles, or portfolio pieces seamlessly. Enhance user experience with a modern layout that adapts responsively, ensuring a stylish and efficient website.
New
Dynamic horizontal timeline Webflow cloneable
Discover a Dynamic Horizontal Timeline Webflow Cloneable by Vincent Bidaux. Showcase events creatively with synced scrolling. Easily update historical milestones or product updates in a visually engaging layout. Ideal for storytelling and boosting user engagement.
New
DarkLuna Portfolio Interaction Webflow cloneable
Elevate your online portfolio with DarkLuna Portfolio Webflow cloneable. Showcase your work with elegance using this modern and minimalist template. Features versatile project sections, advanced CSS effects, and Google Analytics integration for optimized performance. Ideal for designers, freelancers, and creatives seeking a professional online presence.
New
Sticky Horizontal Scrolling Container Webflow cloneable
Discover the Sticky Horizontal Scrolling Container Webflow cloneable by SketchzLab. Showcase timelines and milestones with ease using this seamless combination of sticky positioning and horizontal scrolling. Elevate your project with a visually compelling design and a user-friendly interface for a more immersive web experience.
New
GSAP Scroll-triggered animation Webflow cloneable
Enhance web interactivity with a scroll-triggered animation Webflow cloneable. Crafted by Timothy Ricks, this tool utilizes GSAP and ScrollTrigger for smooth transitions that dynamically respond to scrolling behavior. Engage visitors, highlight key content, and customize effects for a unique browsing experience. Elevate your site's interactivity and create a compelling online presence.
New
Sticky Scrolling Features section Webflow cloneable
Enhance user interaction with a stylish Features section Webflow cloneable by Dhruv Sachdev. Crafted for modern websites, this cloneable offers a clean layout, engaging animations, and seamless functionality. Elevate your site's user experience and captivate visitors with this customizable and performance-optimized design.
New
Luxy.js Smooth Scroll Webflow cloneable
Enhance your Webflow site with Flowbase Smooth Scroll cloneable. Optimize user experience with Luxy.js integration for seamless scrolling. Customize scroll speed for engaging browsing environments. Improve visual appeal and user retention with this lightweight solution.
New
CSS Horizontal scrolling marquee Webflow cloneable
Elevate your website with this Horizontal Scrolling Marquee Webflow cloneable by Josh Jacobs. Effortlessly add engaging continuous marquee effects to showcase important content without JavaScript. Customize scrolling speed for a tailored experience. Perfect for Webflow users seeking to boost engagement and visual appeal.
similar cloneables