Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>  
    <img alt="" src="http://www.prophotoshow.net/blog/wp-content/uploads/2010/03/Doorway-to-Winter-600x400.jpg" style="height: 400px; width: 960px" id="imgClickAndChange" />
  
  <script>
var i = 0,
    element = document.getElementById("imgClickAndChange"),
    images = ["http://www.prophotoshow.net/blog/wp-content/uploads/2010/03/Doorway-to-Winter-600x400.jpg",
              "http://www.123inspiration.com/wp-content/uploads/2011/05/Travel-Norway-Architecture-600x400.jpg",
              "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTyytbyJJ01D2DWh-n2Mc9aUXJ1JPWdf1QglYkvzfOTw-IVrlg"
             ],
    timer = setInterval(changeImage, 25000);
  
function changeImage() {
  element.src = images[(i >= images.length) ? (i = 0) : i++];
}
element.addEventListener("click", function() {
    changeImage();
    clearInterval(timer);
    timer = setInterval(changeImage, 25000);
}, false);
</script>
</body>
</html>
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
GKDevpro
0viewers