Skip to content

A simple jQuery plugin to create animations of digital number rotation. Compatible with Zepto.

Notifications You must be signed in to change notification settings

cctiger36/rotate-number

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rotate number plugin

A simple jQuery plugin to create animations of digital number rotation. Compatible with Zepto.

Usage

HTML Snippet

<div id="rotate"></div>

Javascript

var rotator = $("#rotate").rotateNumber({digits: 5});

CSS

#rotate {
  font-family: Arial;
}
#rotate .digit {
  width: 30px;
}

Update Number

rotator.setNumber(NEW_NUMBER);

Resize

rotator.resizeDigit(NEW_FONT_SIZE);

Options

OptionDescriptionDefault
digitsNumber of the digits3
digitSizeFont size of the digits50
rotateDurationDuration of the rotate animation0.6 (s)
separatorInsert separator per 3 digits (e.g. ',')None

Demo

Live demo here

About

A simple jQuery plugin to create animations of digital number rotation. Compatible with Zepto.

Resources

Stars

Watchers

Forks

Packages

No packages published