Advertisement
Shailrshah

Change Ad After Every 2 Seconds

Jun 7th, 2014
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2. <head>
  3.     <script language = "javascript">
  4.         function changeImage1(){
  5.             setTimeout("changeImage2()", 2000);
  6.             document.getElementById("ad").src="a.jpg";
  7.         }
  8.         function changeImage2(){
  9.             setTimeout("changeImage1()", 2000);
  10.             document.getElementById("ad").src="b.jpg";
  11.         }
  12.         changeImage2();
  13.     </script>
  14. </head>
  15. <body>
  16.     <img id="ad"/>
  17. </body>
  18. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement