UPDATE 24/08/2010: Various fixes and updates have now been incorporated, and the instructions below have been updated.
It’s a simple plugin that takes a text box and turns it into a fruit machine style number updater. It’s easier to see than explain, so take a look at the demo.
There are a couple of things you need to know to use it:
1> Include the js file after your jquery include:
2> Call the totaliser against a textbox to create it:
3> When you want to update it just call UpdateTotaliser with a new number:
There are a few configurable options for the totaliser:
- digits – this sets how many digits the totaliser displays (default is 9)
- currency – set this to false if you don’t want to show the currency symbol
- currencySign – this sets what currency symbol shows before the number (default is british pounds).
So for example to load it up with the dollar sign and only 6 digits you’d call the following: