A simple jQuery plugin to create animations of digital number rotation. Compatible with Zepto.
<div id="rotate"></div>
var rotator = $("#rotate").rotateNumber({digits: 5});
#rotate {
font-family: Arial;
}
#rotate .digit {
width: 30px;
}
rotator.setNumber(NEW_NUMBER);
rotator.resizeDigit(NEW_FONT_SIZE);
Option | Description | Default |
---|---|---|
digits | Number of the digits | 3 |
digitSize | Font size of the digits | 50 |
rotateDuration | Duration of the rotate animation | 0.6 (s) |
separator | Insert separator per 3 digits (e.g. ',') | None |