Create a textual dice roll effect. Choose how many 'sides' your dice has. Specify the speed at which the dice rolls and then the duration of the roll. The plugin will change the text of a chosen div to give the effect of a changing dice roll, with a final choice for the result of the roll.
After including jQuery and the rsDice plugin, instantiate rsDice like so:
$(function(){
$('canvas').rsDice();
});
option | description | default | type |
---|---|---|---|
number | Numebr of sides for the dice | 6 | int |
speed | The speed of which the text changes | 100 | int |
duration | The length of time it takes for the dice to roll | 2000 | int |
callBack | Callback functio for when the roll has finished | function |
Click here to view a demo