Nice Poodle, Mister

    jquery-counter

    1.0.2 • Public • Published

    jQuery Counter

    A jQuery plugin to count up a number with start on element visible feature - DOCS

    npm npm npm GitHub stars gzip size

    Getting Started

    1. Install package using NPM or download it from the repository;

    npm install jquery-counter --save

    2. Require jQuery and Counter

    <script src="jquery.min.js"></script>
    <script src="jquery.counterup.min.js"></script>

    or

    require('jquery');
    require('jquery-counter');

    4. Add data attributes

    <span data-counter data-offset="100" data-duration="1000" data-delay="1000">400</span>

    Through data properties you can set the following parameters:

    Prop Type Default Note
    offset String 200 Element top offset (in pixels) based on view top offset to start the animation
    duration String 3000 Time (in milliseconds) to count it up
    delay String 200 Delay (in milliseconds) to start the animation as per the element becomes visible

    5. Call Counter

    $('[data-counter]').counter();

    JavaScript Options

    $('[data-counter]').counter({
        decimals: 0,
        decPoint: ".",
        thousandsSep: ","
    });

    Methods

    $('[data-counter]').counter('bind');

    Install

    npm i jquery-counter

    DownloadsWeekly Downloads

    52

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    10.2 kB

    Total Files

    7

    Last publish

    Collaborators

    • gustavobissolli