Webflow sync, pageviews & more.
NEW

Prevent Body Scroll on Click

Example

Prevent Body Scroll on Click

Description

A technique to stop by scrolling on click in Webflow via a small Javascript snippet. This is perfect for modal popups, navigation dropdowns and other overlays that should prevent the body from scrolling on opening.

Instructions

  1. Add Javascript code snippet to the closing body tag section of your Webflow site.
  2. Update the classes .nav-button and .nav-overlay to the classes you are using
  3. Note: If required for mobile you could use .w-nav-overlay if you haven't set other custom class names

Javascript snippet


<script>
//Lock body scroll when nav is open
          window.addEventListener('DOMContentLoaded', (event) => {
            $('.nav-button, .nav-overlay').click(function() {
              if ($('body').css('overflow') !== 'hidden') {
                $('body').css('overflow', 'hidden');
              } else {
                $('body').css('overflow', 'auto');
              }
            });
          });
</script>

CSS snippet

HTML snippet

Disable/Enable Clicking on Element

Disable/Enable Clicking on Element

Control which elements can or cannot be clicked on your Webflow site with this simple CSS code snippet.

Mirror Click Script

Mirror Click Script

Trigger a click on another element when one element is clicked in Webflow. This is perfect for allowing one element to control a click of another element.

Custom Scrollbar

Custom Scrollbar

Create a custom scrollbar for your Webflow site with this CSS code snippet. Change the boring, static browser scrollbar design of your Webflow site to a unique design.

CMS Add to Calendar Button

CMS Add to Calendar Button

Add a Calendar button for via your Webflow CMS via this custom Javascript and CSS. This enables your users to easily add events to their calendars based on dates/information in your Webflow CMS.

Scroll to Top of Page on Tab Click

Scroll to Top of Page on Tab Click

Automatically scroll a user to the top of page on a tab change on your Webflow site. A simple Javascript code snippet that allows for you to scroll users to the top of your site based on your selected class.

Randomize button text on click

Randomize button text on click

This allows you to randomize the text on a button click in Webflow. A fun way of displaying a variety of different texts when a user clicks on a button on your Webflow page.

Add Random Sticker to Page on Click

Add Random Sticker to Page on Click

A fun unique way of adding a random sticker to your Webflow site on click.

Scroll overflow move on click

Scroll overflow move on click

Utilize buttons to move between cards within an overflow: scroll wrapper to a specified card via each button in Webflow. This uses a simple JS code to allow seamless transitions between various cards of your choosing using an overflowed wrapper.

DRAG
Real-time sorting by
Hide/show Items based on URL Parameter

Hide/show Items based on URL Parameter

Show or hide divs or elements based on the parameter within a URL in Webflow. This Javascript code allows you to make your Webflow site even more dynamic by allowing you to customize elements on the page based on the URL parameter provided.

Reload Page after Form Submit

Reload Page after Form Submit

Automatically refresh your Webflow site's page after a form submit with this Javascript snippet. A great way of indicating that a form has been submitted to a user or refreshing the page for another submission.

Count Up Numbers on Page Scroll

Count Up Numbers on Page Scroll

When scrolling down the page numbers count up as they enter browser view via this Javascript snippet on your Webflow site. An easy way to add number count up to your Webflow site.

Prevent Input Zoom Scaling on Mobile

Prevent Input Zoom Scaling on Mobile

Prevent an input form zoom scaling on mobile on your Webflow site. This allows for a better user experience based on your sites design rather than mobile OS zoom default properties.

SVG Clip-path for Custom Image Cropping

SVG Clip-path for Custom Image Cropping

Create a responsive clip path for images using SVG shapes in Webflow.This allows you to create unique shaped images using SVG paths rather than DIVs or similar methods.

International Flags Phone Number Input

International Flags Phone Number Input

Add international flags to a phone number for input in Webflow. Adding this allows for a unique way of adding international flags to a phone form field in your Webflow site.

Infinite CSS Marquee/Ticker Logo

Infinite CSS Marquee/Ticker Logo

An easy way to utilize CSS for Logo marquees and other sections in your Webflow site. An easier way to create an infinite looping marquee on your Webflow site than creating them manually with Webflow interactions.

Truncate multi-line text with Ellipse

Truncate multi-line text with Ellipse

Do you want consistency with your Webflow designs? Truncate multi-line texts with ellipses based on 2 or 3 lines of your choosing via CSS. This helps keep your designs uniformed without needing to set max height limitations by truncating text that goes beyond a certain length.

DRAG
Real-time sorting by