Skip to content

A number scroller module to be embeded in your web apps

License

Notifications You must be signed in to change notification settings

wpeikai/scroller

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scroller

A number scroller module to be embeded in your web apps.

It's easy to set up

  1. Include the scroller.js into your WEB page with <script type="text/javascript" src="scroller.js"></script>

  2. 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

  3. Start the scroller by calling scroller.start(number); Here number is the initial number to start, e.g 100

  4. 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.

About

A number scroller module to be embeded in your web apps

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published