Simple Animated Counter Plugin For jQuery - Counter Plus One

File Size: 5.43 KB
Views Total: 1882
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Simple Animated Counter Plugin For jQuery - Counter Plus One

Counter Plus One is a simple jQuery counter plugin that allows you to animate a number counter with custom triggers. Useful for multiple purposes like social likes, post views, newsletter subscribers, time counters, etc.

How to use it:

1. Include the jQuery library and the jQuery counter plus one plugin's JS and CSS in the HTML page.

<link rel="stylesheet" href="styles/jcpo.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="js/jquery.counter.js"></script>

2. Create the Html for a simple counter with a initial number and a default trigger.

<div class="jcpo-counter counter-demo">
  <p>00001</p>
</div>

<button type="button" class="jcpo-plusone">Counter + 1</button>

3. Initialize the plugin with default settings.

$(".counter-demo").counter();

4. Initialize the plugin with a custom trigger. countTrigger can be anything that triggers $.counter.plusOne($counter) but should always be wraped in function ($counter) {}.

$('.counter-demo').counter({
val: '00001',
triggerEvent: 'mouseover',
triggerElement: '.jcpo-plusone-custom'
});

This awesome jQuery plugin is developed by jgleiser. For more Advanced Usages, please check the demo page or visit the official website.