Webflow sync, pageviews & more.
NEW

Count Up Numbers on Page Scroll

Example

Count Up Numbers on Page Scroll

Description

Add count up numbers on page scroll to your Webflow site via this Javascript code. This method allows you to add a count up numbers via a page scroll to your Webflow site. As the user scrolls down numbers start to count up as they enter the viewport.

Instructions

  1. Add a class of counter to a number, do not use any commas in the initial number within the HTML as the JS will automatically ad them.
  2. Add the Javascript code to the sections as mentioned in the commented markup

Javascript snippet


<!-- Add to head section -->
<script src="https://unpkg.com/animejs@3.1.0/lib/anime.min.js"></script>

<!-- Add to closing body -->
<script>
function countup(el, target) {
  let data = { count: 0 };
  let start = target - 200; //Starting value
  anime({
    targets: data,
    count: [start, target],
    duration: 800,
    round: 1,
    delay: 200,
    easing: 'easeOutCubic',
    update() {
      el.innerText = data.count.toLocaleString();
    } });

}

function makeCountup(el) {
  const text = el.textContent;
  const target = parseInt(text, 10);

  const io = new IntersectionObserver(entries => {
    entries.forEach(entry => {
      if (entry.intersectionRatio > 0) {
        countup(el, target);
        io.unobserve(entry.target);
      }
    });
  });

  io.observe(el);
}

const els = document.querySelectorAll('.counter'); //Class to add to target

els.forEach(makeCountup);
</script>

CSS snippet

HTML snippet

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.

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.

Countdown timer

Countdown timer

Add a countdown timer to your Webflow site with this simple Javascript snippet. Want to display a countdown timer to a time of your choosing on your Webflow site? Now you can easily add one with this Javascript snippet.

Text Hover Animate Underline

Text Hover Animate Underline

When hovering over a text link the links underline animates to provide a unique effect for your Webflow site. This CSS code snippet can be customized based on your specifications.

Number of CMS Item Count

Number of CMS Item Count

A simple way of displaying the number of CMS items on a page in Webflow. If you ever wanted to add a CMS item count on a page this script will allow you to easily display the total number of items shown.

Staggered Interactions

Staggered Interactions

Easily stagger your Webflow interactions via this Javascript code. Add staggered interactions to Webflow CMS items or interactions you may have already built without pulling your hair out. Adding this bit of Javascript code will help create staggered Webflow interactions.

Display/Hide Items based on Count

Display/Hide Items based on Count

1

Hide/show elements on your Webflow Memberstack site based on a conditional value with this Javascript snippet. A great way to implement a credit based system or value based conditional logic for your Memberstack Webflow site.

Wormy Cursor

Wormy Cursor

Add a fun mouse animation to your Webflow site via this JS code snippet. The worm will follow the mouse on the canvas of your Webflow site as a user navigates your site.

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.

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.

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.

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.

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.

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.

Custom Select Styling Multi-Select Input

Custom Select Styling Multi-Select Input

Design your own dropdowns and multi-select inputs in Webflow using Select2. With this Javascript code you'll be able to customize the look and design of the multi-select from the native browser select.

Single Line Truncate Text

Single Line Truncate Text

Automatically truncate text that goes beyond a line on your Webflow site with this simple CSS script. This helps create uniformed design on your site by truncating text with ellipsis if they go beyond a single line.

DRAG
Real-time sorting by