SHARE
TWEET

Untitled

a guest Jan 21st, 2019 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function randomSelect() {
  2.   randomBeer.addEventListener('click', function() {
  3.     var number = Math.floor(Math.random() * 8);
  4.     popUp[number].style.visibility = 'visible';
  5.     popUp[number].style.transform = 'scaleY(1)';
  6.     return number;
  7.   })
  8. }
  9.  
  10.  
  11. function closeRandomSelect() {
  12.   var randSelNumb = randomSelect();
  13.   console.log(randSelNumb);  
  14. }
  15.    
  16. function randomSelect(callback) {
  17.   randomBeer.addEventListener('click', function() {
  18.     var number = Math.floor(Math.random() * 8);
  19.     popUp[number].style.visibility = 'visible';
  20.     popUp[number].style.transform = 'scaleY(1)';
  21.     callback(number);
  22.   })
  23. }
  24.  
  25.  
  26. function closeRandomSelect() {
  27.   randomSelect(function(number){
  28.     console.log(number);  
  29.   });
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top