SHARE
TWEET

evn160519202047

a guest Nov 19th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. firstButton.onclick = () => createBubble();
  2. function createBubble(){
  3.     let num = document.getElementById('number').value,
  4.     bubble = [],
  5.     randomBubble = [];
  6.     while (0<num){
  7.         bubble.push(num--);
  8.     }
  9.  
  10.     for (let i = bubble.length - 1; i>=0 ;i-- ) {
  11.         randomBubble.push(bubble.splice(Math.floor(Math.random() * (i + 1)), 1));
  12.     }
  13.  
  14.     function loopOut(num) {
  15.         setTimeout(function () {
  16.             let inp = document.createElement("span");
  17.             inp.innerHTML = randomBubble[num];
  18.             let outJ = document.getElementById('out');
  19.             outJ.parentNode.insertBefore(inp, outJ);
  20.             num++;
  21.             if(num<randomBubble.length) loopOut(num)
  22.         }, 500)
  23.     }
  24.     loopOut(num);
  25.     return randomBubble;
  26. }
  27. setTimeout(()=>alert(qwe), 5000);
  28. function sortBubble(){
  29.     let a = createBubble();
  30.     alert(a);
  31. }
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