Advertisement
1xptolevitico69

Anonymous function javascript

Jan 4th, 2022
1,410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.40 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.  
  4. <head>
  5.   <title>Anonymous function javascript</title>
  6.   <meta charset="UTF-8">
  7.   <meta name="viewport" content="width=device-width">
  8.   <style>
  9.  
  10.     .clone {
  11.       position: absolute;
  12.       top: 10px;
  13.       left: 10px;
  14.       text-decoration: none;
  15.       background-color: red;
  16.       width: 150px;
  17.       text-align: center;
  18.       color: snow;
  19.       font-family: arial black;
  20.       padding: 5px 20px;
  21.     }
  22.  
  23.     h1 {
  24.       font-size: 40px;
  25.       font-family: courier;
  26.       text-indent: 100px;
  27.       text-align: justify;
  28.       padding: 0 20px;
  29.     }
  30.   </style>
  31. </head>
  32.  
  33. <body>
  34.   <h1 id='p'></h1>
  35.  
  36.   <a class='clone' title="Subscribe and hit the notification bell for more updates. It's free." href='https://www.youtube.com/channel/UCqLpDK0eOsG1eEeF9jOUZkw'>SUBSCRIBE</a>
  37.  
  38.  
  39.  
  40.  
  41.   <script>
  42.     post = 'One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed into a horrible vermin. He lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches into stiff sections. ';
  43.     i = 0;
  44.     setTimeout(function() {
  45.       (start = function() {
  46.         x = requestAnimationFrame(start);
  47.         p.innerHTML += post[i];
  48.         i++;
  49.         if (i == post.length) {
  50.           cancelAnimationFrame(x);
  51.         }
  52.       })();
  53.     }, 2000);
  54.   </script>
  55. </body>
  56. </htm>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement