Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var n = 360; // 6 min of waiting after blocked
- function countDown(){
- n--;
- if(n > 0){
- setTimeout(countDown,1000);
- }
- $( "span#waitcount" ).html( document.createTextNode(n) );
- }
- var count = 50; // Count of tokens when reached 0 block the page
- var counter = document.getElementById('counter');
- var clickDisabled = false;
- $('.slotMachineButton').click(function(){
- if (clickDisabled)
- return;
- setTimeout(function(){
- count--;
- counter.innerHTML = count;
- if (count === 0) {
- $.blockUI({ message: '<h1>Thank you for Playing!!!<br>Please wait for 6 munites to be able to play again.</h1>' });
- setTimeout(function() {
- $.unblockUI({
- onUnblock: function(){ alert('Game has been resumed!!!'); }
- });
- }, 10000);
- setTimeout(countDown,1000);
- }
- });
- clickDisabled = true;
- setTimeout(function(){
- clickDisabled = false;
- }, 3000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement