OhhMuaOhhMua
  • Home
  • Hosting
    • Best Web Hosting
    • Free Web Hosting
    • VPS Hosting
  • WordPress
    • Solutions & Troubleshooting
    • Installation & Setup
    • Themes & Plugins
    • Security
  • Computer Tips
    • Gaming Errors & Solutions
    • PC Troubleshooting
    • Computer Hardware
  • Coupons & Deals
  • Contact Us
Reading: Create a Simple Incrementing Number Effect with HTML and JavaScript
Share
Notification Show More
Font ResizerAa
OhhMuaOhhMua
Font ResizerAa
  • Computer Tips
  • Hosting
  • WordPress
Search
  • Home
  • WordPress
    • Installation & Setup
    • Security
    • Solutions & Troubleshooting
    • Themes & Plugins
    • Troubleshooting
  • Hosting
    • Free Web Hosting
    • VPS Hosting
    • Best Web Hosting
  • Computer Tips
    • Computer Hardware
  • Coupons & Deals
Have an existing account? Sign In
Follow US
Copyright © 2024 ohhmua. All rights reserved.
OhhMua > Blog > WordPress > Solutions & Troubleshooting > Create a Simple Incrementing Number Effect with HTML and JavaScript
Solutions & Troubleshooting

Create a Simple Incrementing Number Effect with HTML and JavaScript

ohhmua
Last updated: September 17, 2024 4:14 pm
ohhmua
Share
3 Min Read
Create a Simple Incrementing Number Effect with HTML and JavaScript 2
Create a Simple Incrementing Number Effect with HTML and JavaScript 2
SHARE
Contents
Step 1: Create the number with HTMLStep 2: Copy the JavaScript code

Hello everyone, during my web development journey, I often encounter client requests to display data with an increasing number effect, which makes the website more dynamic and engaging. Today, I will share with you a very simple way to create an incrementing number effect using HTML and JavaScript!

Create a Simple Incrementing Number Effect with HTML and JavaScript 2
Create a Simple Incrementing Number Effect with HTML and JavaScript

This tutorial uses the Flatsome theme, so if you are using the Flatsome theme, you can follow it exactly. If you’re using a different theme, you might need to tweak the code or the steps to make it work for your setup.

Step 1: Create the number with HTML

Using the UX Builder in the Flatsome theme, edit the page and insert a custom HTML block by following the instructions as shown in the image below:
Create your desired HTML code, consisting of two separate parts: the running number part and the explanation part, as shown in the image. The running number part will have the class "item-number" and the attribute data-count="desired final number". Just follow this format and change the number as needed! (the part highlighted in green).

Create a Simple Incrementing Number Effect with HTML and JavaScript 3
Create a Simple Incrementing Number Effect with HTML and JavaScript 
<p style="text-align: center;">
  <strong class="item-number" id="number_1" data-count="7">7</strong><br />
  Instructional article from ohhmua.com, thank you for watching
</p>

Step 2: Copy the JavaScript code

Go to the Advanced settings in Flatsome – Global Setting – Footer Script, and copy and paste the following code into that section.

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script><br />
<script>$('.item-number').each(function () {$(this).prop('item-number',0).animate({Counter: $(this).text()}, {duration: 7000,easing: 'swing',step: function (now) {$(this).text(Math.ceil(now));}});
});</script>
Create a Simple Incrementing Number Effect with HTML and JavaScript 1
Create a Simple Incrementing Number Effect with HTML and JavaScript

Please note, if you want the number to run slower, you can adjust the value in the duration:7000 section!

You Might Also Like

My Google Discover traffic skyrocketed after I did these 10 things

How to Add a “Read More” and “Show Less” Button to Product Descriptions in WooCommerce

Blog, E-Commerce, or Forum? WordPress Covers Every Website Type!

How I Optimized Pagination and Skyrocketed Traffic

How to Pick the Ideal Blogging Platform for Your Needs

TAGGED:HTML and JavaScript
Share This Article
Facebook Twitter Email Print
Leave a comment Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Trending Stories

How to Choose the Right Motherboard for Intel 14th Gen Processors
Computer Hardware

How to Choose the Right Motherboard for Intel 14th Gen Processors

April 22, 2025
GTA6 Trailer 2
Gaming Errors & Solutions

GTA6 Trailer 2: The Hidden Easter Eggs You Didn’t Notice

May 8, 2025
5 Signs It's Time to Upgrade Your Computer 5
Computer Tips

5 Signs It’s Time to Upgrade Your Computer

July 24, 2023
Comprehensive Computer Beep Codes [Help You Fix Errors]
Computer Hardware

Comprehensive Computer Beep Codes [Help You Fix Errors]

August 22, 2020
WordPress Covers Every Website Type
Solutions & Troubleshooting

Blog, E-Commerce, or Forum? WordPress Covers Every Website Type!

April 29, 2025
Create a Simple Incrementing Number Effect with HTML and JavaScript 2
Solutions & Troubleshooting

Create a Simple Incrementing Number Effect with HTML and JavaScript

September 17, 2024

You Might Also Like

Protecting Your WordPress Site from File Upload Vulnerabilities
Solutions & Troubleshooting

Protecting Your WordPress Site from File Upload Vulnerabilities

September 26, 2024
Title and Meta Description Mismatch on Google
Solutions & Troubleshooting

Title and Meta Description Mismatch on Google[How to fix]

September 25, 2024
Contact button
Solutions & Troubleshooting

Contact button in the footer with added call button shake effect

September 21, 2024
Guide to Creating a Beautiful Promotion Notification Box for Your Website
Solutions & Troubleshooting

How to Create a Stunning Notification Box for Your Website

September 20, 2024
Previous Next
newsletter featured

Always Stay Up to Date

Subscribe to our newsletter to get our newest articles instantly!

Follow US on Social Media

Facebook Youtube Steam Twitch Unity

Copyright © 2024 ohhmua. All rights reserved.

OhhMua

Information

  • About
  • Terms & Conditions
  • Privacy Policy
Welcome Back!

Sign in to your account

Lost your password?