0

I create a fortune wheel which is automatically spin after the interval of 30 second for now. But I am facing some problem in this and the problem is it should spin at same time at each machine. any body open this spin at any time it during its spinning time it should be spin and get the same result on each system

My Codepen

Here is the auto spin code

setInterval(function () {

           var $r = $('.roulette').fortune(prices);

    $r.spin().done(function(price) {
    $('.price').text(price);
     $('.result_number_circle').text(price);

  });
    //  $('.roulette').animate({rotate: '+=10deg'}, 0);
    },30000);
Azad Chouhan
  • 270
  • 1
  • 5
  • 20
  • You should have a server handling this – Weedoze Apr 25 '17 at 06:19
  • You need a server component as well then, which would be called by the client component, and all of the clients then get/see the same result. Otherwise, a sync solely based on client code is hard to achieve. – Exception_al Apr 25 '17 at 06:20
  • can you please show me any code sample please if possible @Exception_al – Azad Chouhan Apr 25 '17 at 06:31
  • Look at this [Link](http://stackoverflow.com/questions/4112686/how-to-use-servlets-and-ajax) .. a simple example to create a servlet ... make an ajax call and get data from servlet. – Exception_al Apr 25 '17 at 07:38

0 Answers0