Creates a wheel of fortune based on http://jsfiddle.net/jquery4u/sNYYD/
Here is the demo
$('#foo').wof(options [,callback]);
Change the element of the wheel.
// Default: $(this)
$('#foo').wof({
wheel: $('#bar')
});
Set an element as the marker. And oh boy, is it animated...
// Default: false
$('#foo').wof({
marker: $('#marker')
});
Enable the click event on a button, straight out of the box. When not set, the wheel will start spinning by itself.
// Default: $(this)
$('#foo').wof({
button: $('#button)
});
The array of prizes to share. This has to be the same as the wheel, but can be modified in this way.
// Default: false, you need to set some prizes
$('#foo').wof({
prizes: [1, 2, 3, 4, 5, 6, 7, 8]
});
What is the time of the animation in milliseconds.
// Default: 6000
$('#foo').wof({
duration: 10000
});
Allow users to participate more than once.
// Default: false. People can only win once
$('#foo').wof({
multiple: false
});
Want to set a fix ending? Now you can.
// Default: false
$('#foo').wof({
wonPrize: 6
});
Set a timeout on the spin. Best used when it starts automatically.
// Default: false
$('#foo').wof({
timeout: 1000
});
Set a different easing method.
// Default: 'cubic-bezier(.25,0,.17,1)'
$('#foo').wof({
easing: 'linear'
});
When the animation ends, fire this. Won prize is available
$('#foo').wof({
...
}, function(data){
// Set callback functions
});