Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <!-- Global site tag (gtag.js) - Google Analytics -->
- <script async="" src="https://www.googletagmanager.com/gtag/js?id=G-420XFJRS1M"></script>
- <script>
- window.dataLayer = window.dataLayer || [];
- function gtag() {
- dataLayer.push(arguments);
- }
- gtag('js', new Date());
- gtag('config', 'G-420XFJRS1M');
- </script>
- <link rel="shortcut icon" href="https://1xpto.netlify.app/items/favicon.gif" type="image/x-icon">
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="keywords" content="Display info from html module">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Display info from html module</title>
- <style>
- body {
- margin: 0;
- font-family: calibri;
- }
- .info {
- background-color: red;
- display: block;
- margin: 10px auto;
- width: 50%;
- padding: 10px 0;
- }
- .info h2 {
- text-align: center;
- }
- h1 {
- font-family: verdana;
- padding: 50px 20px;
- }
- .app {
- font-size: 16px;
- z-index: 1;
- text-decoration: none;
- font-family: verdana;
- font-weight: bold;
- color: red;
- position: absolute;
- top: 0;
- right: 0;
- margin: 5px;
- border: 2px solid red;
- padding: 5px 10px;
- }
- @media all and (orientation: portrait) and (max-width: 425px) {
- .info {
- width: 60%;
- }
- .app {
- word-wrap: break-word;
- width: 20px;
- }
- h1 {
- font-size: 18px;
- }
- }
- @media all and (orientation: landscape) and (max-width: 640px) {
- .info {
- width: 60%;
- }
- .app {
- word-wrap: break-word;
- width: 20px;
- }
- h1 {
- font-size: 18px;
- }
- }
- </style>
- </head>
- <body>
- <a class='app' href='https://1xpto.netlify.app/'>Visite Site</a>
- <module class='info'>
- <h2>John 32 years old has broken a tooth.</h2>
- <h2>Henrietta 40 year old, single, wants to marry right now.</h2>
- <h2>Marcus 10 years old loves his pet.</h2>
- </module.info>
- <script>
- i = 0;
- a = 0;
- x = document.getElementsByTagName('h2');
- list_content = x[i].innerHTML;
- foo = x.length;
- document.body.appendChild(h1 = document.createElement('h1'));
- stop = setInterval(loop, 100);
- function loop() {
- if (i == foo) {
- clearInterval(stop);
- } else {
- h1.innerHTML += '<i>' + list_content[a] + '</i>';
- window.scrollBy(0, 100);
- a++;
- if (a == list_content.length) {
- h1.innerHTML += '<br>';
- i++;
- list_content = x[i].innerHTML;
- a = 0;
- }
- }
- }
- </script>
- </body>
- </htm>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement