Cześć, posiadam ten skrypt z jakieś ruskiej strony ale dużo go testowałem i działa dobrze, tylko mam jeden problem nie mam pojęcie jak dodać do niego czas np:30 sekund po którym ten skrypt się włączy ponownie, dodam ze jest to ruletka, jestem zielony w tej sprawie szukam pomocyyy
$(function () {
function indexRandom(lng){
var a = {},i,out=[],n=0;
for(i=0;i<lng;i++)a[i]=i;
while (n!=lng){
i
= Math
.floor(lng
*Math
.random
()); if(typeof(a[i])!='undefined'){
out.push(a[i]);
delete a[i];
n++;
}
}
return out;
}
var i, arr = [];
for(i=0;i<185;i++)arr.push(i%37); //создали массив включающий 5 подмассивов от 0 до 36;
RestarRound = function(){ $('.round').remove();
var ind = indexRandom(185);
var a = '<td class="A';
var b = '"></td>';
var str='<table class=round><tbody><tr></tr></tbody><table>';
$('.wrap-ruletka').append(str); str = '';
for(i=0;i<186;i++){
if(!!i&&!(i%37)){$('.round').css({'width':''+(65*i)+'px'}).find('tr:first').append(str); str = '';}
if(i==180){str+= a + arr[ind[i]]+'"><img src="http://s7.uploads.ru/t/xfyR4.png" width=100% style="margin-bottom:-12px;"></td>';continue;}
if(i==185) break;
str+= a + arr[ind[i]]+b;
}
setTimeout(function(){ $('.round:last').css({'left':'-'+(65*175)+'px'});},1700);
}
$('[type="button"]').click(RestarRound);
})