CountUP Class sandbox

Developer
Size
3,229 Kb
Views
34,408

How do I make an countup class sandbox?

What is a countup class sandbox? How do you make a countup class sandbox? This script and codes were developed by NaKaz on 31 August 2022, Wednesday.

CountUP Class sandbox Previews

CountUP Class sandbox - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>CountUP Class sandbox</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div> <p id="resultTx1">1,800</p> <p id="resultTx2">2,100</p> <p id="resultTx3">01</p>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/underscore.string/2.3.3/underscore.string.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

CountUP Class sandbox - Script Codes CSS Codes

#resultTx1,
#resultTx2,
#resultTx3{ font-family: 'dinc', Arial, sans-serif; font-size: 97px; color:#999; line-height: 1.1; margin : 0; padding: 0;
}

CountUP Class sandbox - Script Codes JS Codes

(function() { (function($, win, doc, _) { var $doc, $win, CounterFunc, num, separateFigure; $win = $(win); $doc = $(doc); CounterFunc = (function() { function CounterFunc(targetID1, initial1) { this.targetID = targetID1; this.initial = initial1; this.writeElm = doc.getElementById(targetID); this.cur_Count = 0; this.end_Count = 55; this.n = 6; if (this.nowPrice !== 0) { this.nowPrice = parseInt(this.writeElm.innerHTML.replace(",", ""), 10); } this.NextPrice = initial; this.moves(); } CounterFunc.prototype.moves = function() { var cntFunc, self; self = this; cntFunc = function() { var c; if (self.cur_Count <= self.end_Count) { c = self.cur_Count++ / self.end_Count; self.writeElm.innerHTML = self.addFigures((self.NextPrice - (self.NextPrice - self.nowPrice) * Math.pow(1 - c, self.n)).toFixed(0)); return setTimeout(cntFunc, 30); } else { self.nowPrice = this.NextPrice; return self.writeElm.innerHTML = self.addFigures(self.NextPrice); } }; return cntFunc(); }; CounterFunc.prototype.addFigures = function(str) { var num, self; self = this; num = str.toString().replace(/,/g, ""); while (num != (num = num.replace(/^(-?\d+)(\d{3})/, "$1,$2"))); return num; }; return CounterFunc; })(); num = 1234567; separateFigure = function(num) { return (num + "").replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,"); }; if (typeof console !== "undefined" && console !== null) { console.info("separateFigure:", separateFigure(num)); } if (typeof console !== "undefined" && console !== null) { console.info("toLocaleString:", num.toLocaleString()); } if (typeof console !== "undefined" && console !== null) { console.info("_.string:", _.numberFormat(num, 3)); } return $(function() { new CounterFunc("resultTx1", 234567); new CounterFunc("resultTx2", 12345); return new CounterFunc("resultTx3", 7777); }); })(jQuery, this, this.document, _.string);
}).call(this);
CountUP Class sandbox - Script Codes
CountUP Class sandbox - Script Codes
Home Page Home
Developer NaKaz
Username nakakaz11
Uploaded August 31, 2022
Rating 3
Size 3,229 Kb
Views 34,408
Do you need developer help for CountUP Class sandbox?

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!

NaKaz (nakakaz11) Script Codes
Create amazing love letters 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!