Skip to content

Latest commit

 

History

History
67 lines (52 loc) · 1.09 KB

README.md

File metadata and controls

67 lines (52 loc) · 1.09 KB

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