Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Arrow function javascript</title>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width">
- <style>
- .clone {
- position: absolute;
- top: 10px;
- left: 10px;
- text-decoration: none;
- background-color: snow;
- width: 150px;
- text-align: center;
- color: red;
- font-family: arial black;
- padding: 5px 20px;
- }
- body {
- background-color: red;
- }
- h1 {
- font-size: 40px;
- font-family: courier;
- text-indent: 100px;
- text-align: justify;
- padding: 0 20px;
- color: snow;
- font-style: italic;
- }
- </style>
- </head>
- <body>
- <h1 id='p'></h1>
- <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>
- <script>
- 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. ';
- i = 0;
- setTimeout(function() {
- (start = () => {
- x = requestAnimationFrame(start);
- p.innerHTML += post[i];
- i++;
- if (i == post.length) {
- cancelAnimationFrame(x);
- }
- })();
- }, 2000);
- </script>
- </body>
- </htm>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement