Skip to content

maksymblank/spinteger

Repository files navigation

logo

An awesome replacement for .innerText / .innerHTML

spinteger example

Installation

$ npm install spinteger --save
$ bower install spinteger --save

or use CDN

<script src="https://spinteger.maksymblank.com/dist/spinteger.min.js"></script>

Usage

<script src="bower_components/spinteger/dist/spinteger.min.js"></script>
import spinteger from 'spinteger'

var spinNumber = spinteger(document.querySelection('#number'));

spinNumber.val(1230329) // any number

Examples

<span id="number">1873656</span>
var num = spinteger(document.querySelector('#number'),{
   fontSize: 40, // Default: inherit or 16px
   separator: '#', // Default: ''
   tofixed: 2, // Default: 0
   step: 2, // Default: 1
   speed: 100, // Default: 50
   before: '$', // Default: ''
   after: '$' // Default: ''
});

num.val(3892382);

Documentation

About

Animated spinning numbers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published