A number scroller module to be embeded in your web apps.
It's easy to set up
-
Include the scroller.js into your WEB page with <script type="text/javascript" src="scroller.js"></script>
-
Create a Scroller instance by callying Scroller.getNewInstance(props) var scroller=Scroller.getNewInstance({ direction:Scroller.DIRECTION.UP, interval:3000, width:200, amount:80, seperatorType:Scroller.SEPERATOR.THOUSAND, seperator:"," });
--direction : Scroll direction, currently supported direction is UP. Default is UP
--interval : The time interval to scroll from start to end number in milliseconds. Default is 5 seconds
--width : The scroller panel width in px. Default is 400px
--amount : The amount of px to scroll for each number,e.g 0->1,1->2,2->3......Default is 250px
--seperatorType : The seperatorType to be used, default is NONE. Possible values are Scroller.SEPERATOR.[NONE|THOUSAND|TIME]
--seperator : The seperator symbol,e.g ",". Default is no seperator
You can omit one or all the properties above. The default value is used if the property is not specified -
Start the scroller by calling scroller.start(number); Here number is the initial number to start, e.g 100
-
Scroll to the number you want by calling scroller.scrollTo(number);
You can modify the style of the scroller panel by modifying the scroller.css file. The class .scroller-span is the the panel for each individual digit. More classes will be added.