What is the easiest way to make jQuery counter up?

Home Forums Web Design What is the easiest way to make jQuery counter up?

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #1366
    Mofizul
    Keymaster
    <!DOCTYPE html>
    <html lang="en">
    <head>
    	<meta charset="UTF-8">
    	<title>Document</title>
    </head>
    <body>
    	<div class="counter-number">5000</div>
    	<div class="counter-number">700</div>
    	<div class="counter-number">4500</div>
    	<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
    	<script>
    		$('.counter-number').each(function () {
    			$(this).prop('Counter',0).animate({
    				Counter: $(this).text()
    			}, {
    				duration: 8000,
    				easing: 'swing',
    				step: function (now) {
    					$(this).text(Math.ceil(now));
    				}
    			});
    		});
    	</script>
    </body>
    </html>
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.