Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head><title>Task 1</title></head>
- <body>
- <script type="text/javascript">
- var i = 1;
- setTimeout(imageChanger, 1000);
- function imageChanger(){
- //var r = Math.floor(((Math.random()*16)+1));
- //document.getElementById("image").src="pics/" + r + ".jpeg";
- document.getElementById("image").src="pics/" + i + ".jpeg";
- if(i == 16){
- i = 1;
- }
- else{
- i++;
- }
- setTimeout(imageChanger, 1000);
- }
- </script>
- <img id = "image" src = "pics/1.jpeg" width = 400 heigh = 200/>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement