Guest User

Untitled

a guest
Jan 21st, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  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. }
Add Comment
Please, Sign In to add comment