Advertisement
1xptolevitico69

Javascript autoplay slider (no arrow controls)

Dec 31st, 2021
1,721
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.64 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.  
  4. <head>
  5.     <link rel="shortcut icon" href="Favicon.gif" type="image/x-icon">
  6.     <meta charset="UTF-8">
  7.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  8.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  9.     <title>Javascript autoplay slider (no arrow controls)</title>
  10. <style>
  11. img {
  12.     position: absolute;
  13.     width: 100%;
  14.     height: 100%;
  15. }
  16.  
  17. #section {
  18.     position: relative;
  19.     margin: auto;
  20.     width: 800px;
  21.     height: 500px;
  22.     border: 5px solid red;
  23.     border-radius: 5px;
  24. }
  25.  
  26.  
  27. .clone{
  28. position:absolute;
  29. top:0;
  30. right:0;
  31. }
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39. </style>
  40. </head>
  41.  
  42. <body>
  43.     <section id='section'>
  44.     <img src='https://1xpto.netlify.app/pics/3.jpg' />
  45.     <img src='https://1xpto.netlify.app/pics/4.jpg' />
  46.     <img src='https://1xpto.netlify.app/pics/7.jpg' />
  47.     <img src='https://1xpto.netlify.app/pics/pic1.jpg' />
  48.     <img src='https://1xpto.netlify.app/pics/pic2.png' />
  49.     <img src='https://1xpto.netlify.app/pics/pic3.png' />
  50.     <img src='https://1xpto.netlify.app/pics/car.jpeg' />
  51.     </section>
  52.  
  53.  
  54.     <a class='clone' href='https://www.youtube.com/channel/UCqLpDK0eOsG1eEeF9jOUZkw'><img style='width:200px;position:relative;' src='https://1xpto.netlify.app/pics/clone.png'/></a>
  55.  
  56.  
  57.  
  58.  
  59.  
  60.     <script>
  61.  
  62. image = document.getElementsByTagName('img');
  63. i = 6;
  64.  
  65. del = setInterval(bam, 2000);
  66. function bam() {
  67.     image[i].style.display = 'none';
  68.     i--;
  69.     if (i == -1) {
  70.         i = 6;
  71.         for (a = 0; a < image.length; a++) {
  72.            image[a].style.display = 'block';
  73.        }
  74.    }
  75. }
  76.  
  77.  
  78. </script>
  79. </body>
  80.  
  81. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement