Advertisement
ZazoTazo

Images

Dec 7th, 2020
1,048
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.75 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.     <head><title>Task 1</title></head>
  4.     <body>
  5.         <script type="text/javascript">
  6.             var i = 1;
  7.             setTimeout(imageChanger, 1000);
  8.             function imageChanger(){
  9.                 //var r = Math.floor(((Math.random()*16)+1));
  10.                 //document.getElementById("image").src="pics/" + r + ".jpeg";
  11.                 document.getElementById("image").src="pics/" + i + ".jpeg";
  12.                 if(i == 16){
  13.                     i = 1;
  14.                 }
  15.                 else{
  16.                     i++;
  17.                 }
  18.                 setTimeout(imageChanger, 1000);
  19.             }
  20.         </script>
  21.         <img id = "image" src = "pics/1.jpeg" width = 400 heigh = 200/>
  22.     </body>
  23. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement