Skip to content

charliefancelli/jQuery-SlotMachine

 
 

Repository files navigation

#jQuery-SlotMachine Build Status

A simple, lightweight jQuery plugin to make slot machine animation effect.

[Check the example page!] (http://josex2r.github.io/jQuery-SlotMachine/)

Installation

Include the script after the jQuery library:

<script src="/path/to/jquery.slotmachine.js"></script>

Usage

Creating the machine:

var machine = $(foo).slotMachine( params );

Shuffle:

machine.shuffle( repeat, onStopCallback ); //No args to make rotate infinitely

Change the selected element:

machine.prev(); //Previous element

machine.next(); //Next element

Get selected element:

machine.active(); //Returns element index inside an object

Check if the machine is running:

machine.isRunning(); //Returns boolean

Params

Params must be an object, optionally containing the next parammeters:

active

Set the first element

active: 0

delay

Set spin animation time

delay: 200

repeat

Pass an int as miliseconds to make the machine auto rotate

repeat: false

Authors

Jose Luis Represa

##License

jQuery-SlotMachine is released under the MIT License.

About

Makes Slot Machine effect in your html!

Resources

License

Stars

Watchers

Forks

Packages

No packages published