Jquery fortune wheel getting wrong result
I am creating a fortune wheel using jquery and want to getting the exact number from the spinning wheel
Jquery I am using this in html
$( document ).ready(function() {
var prices = [
{
name: '0'
},
{
name: '1'
},
{
name: '2'
},
{
name: '3'
},
{
name: '4'
},
{
name: '5'
},
{
name: '6'
},
{
name: '7'
},
{
name: '8'
},
{
name: '9'
},
{
name: '10'
},
{
name: '11'
},
{
name: '12'
},
{
name: '13'
},
{
name: '14'
},
{
name: '15'
},
{
name: '16'
},
{
name: '17'
},
{
name: '18'
},
{
name: '19'
},
{
name: '20'
},
{
name: '21'
},
{
name: '22'
},
{
name: '23'
},
{
name: '24'
},
{
name: '25'
},
{
name: '26'
},
{
name: '27'
},
{
name: '28'
},
{
name: '29'
},
{
name: '31'
},
{
name: '32'
},
{
name: '33'
},
{
name: '34'
},
{
name: '35'
},
{
name: '36'
}
];
setInterval(function () {
var $r = $('.roulette').fortune(prices);
$r.spin().done(function(price) {
$('.price').text('Hourly Number ' + price.name);
});
// $('.roulette').animate({rotate: '+=10deg'}, 0);
},30000);
});
})(jQuery);
I am not sure where I am going with this code. everytime its spin its give me incorrect result.Please May be I am confuse with the logic behind this spinning wheel. Please help me with this
Here is the live example of what i created so far. Please guide me what I have to do to get the accurate result