Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script>
- var te;
- function inicio(){
- te=setInterval(cambia,1000);
- //settimeout lo hace solo un vez
- }
- function parar(){
- clearInterval(te);
- }
- function cambia(){
- var foto=document.images[3].src;
- document.images[3].src=document.images[2].src;
- document.images[2].src=document.images[1].src;
- document.images[1].src=document.images[0].src;
- document.images[0].src=foto;
- }
- </script>
- </head>
- <body>
- <center>
- <img src="1.jpg" width="200" height="200" >
- <img src="2.jpg" width="200" height="200" >
- <img src="3.jpg" width="200" height="200" >
- <img src="4.jpg" width="200" height="200" >
- <input type="button" value="STOP" onclick="parar()">
- <input type="button" value="START" onclick="inicio()">
- </center>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement