Count up

Developer
Size
2,391 Kb
Views
22,264

How do I make an count up?

What is a count up? How do you make a count up? This script and codes were developed by Alan Shortis on 14 November 2022, Monday.

Count up Previews

Count up - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Count up</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="number">820</div>
<div class="number">1250</div>
<div class="number">200</div> <script src="js/index.js"></script>
</body>
</html>

Count up - Script Codes CSS Codes

@import url("https://fonts.googleapis.com/css?family=Roboto");
html { height: 100%;
}
body { display: flex; align-items: center; justify-content: space-around; min-height: 100%; background-color: #333333; color: #fefefe;
}
.number { font-size: 3rem; font-family: 'Roboto';
}

Count up - Script Codes JS Codes

function _countUp(numberElement) { var current = 0; var total = parseInt(numberElement.innerHTML); var countSpeed = Math.abs(Math.floor(2000 / total)); var timer = setInterval(function countIt() { current += 1; numberElement.innerHTML = current.toLocaleString(); (current == total) && clearInterval(timer); }, countSpeed);
}
var elements = document.querySelectorAll('.number');
for (var i = 0; i < elements.length; i++) { _countUp(elements[i]);
}
Count up - Script Codes
Count up - Script Codes
Home Page Home
Developer Alan Shortis
Username alanshortis
Uploaded November 14, 2022
Rating 3
Size 2,391 Kb
Views 22,264
Do you need developer help for Count up?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Alan Shortis (alanshortis) Script Codes
Create amazing SEO content with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!