Skip to content

Commit

Permalink
Added new functionality, slot machines can be tricked whit a custom r…
Browse files Browse the repository at this point in the history
…andomize function. Fixed #1
  • Loading branch information
josex2r committed Jun 23, 2014
1 parent dfce534 commit f71bf9c
Show file tree
Hide file tree
Showing 6 changed files with 727 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ module.exports = function(grunt) {
grunt.registerTask('default', ['jshint', 'qunit', 'clean', 'concat', 'uglify']);

// Travis CI task.
grunt.registerTask('travis', ['jshint', 'qunit']);
grunt.registerTask('travis', ['jshint', 'qunit', 'clean', 'concat', 'uglify']);

};
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,22 @@ Set spin animation time
Pass an int as miliseconds to make the machine auto rotate

repeat: false

### randomize

Pass a function to select your own random element. This function must return an integer between 0 (first element) and max number of elements.

randomize: function(activeElementIndex){} //activeElementIndex = current selected index

Example (this machine always shows first element):

```javascript
$('#foo').slotMachine({
randomize : function(activeElementIndex){
return 0;
}
});
```

## Authors

Expand Down
Loading

0 comments on commit f71bf9c

Please sign in to comment.