Rotating Images

Rotating Image and Dynamically Change the Link



<html><head><title>Javascript Rotation</title>
<script language="javascript1.1">
var frames;
images=new Array(5);
links=new Array(5)
images[0]=new Image();
images[0].src="3ds_1.gif";
images[1]=new Image();
images[1].src="3ds_2.gif";
images[2]=new Image();
images[2].src="3dsbible.jpg";
images[3]=new Image();
images[3].src="3dsfundamentals.gif";
images[4]=new Image();
images[4].src="dreamweaver.jpg";
links[0]=new String();
links[0].value="http://www.amazon.com/exec/obidos/
ISBN=1562054198/listensoftwareso/";
links[1]=new String();
links[1].value="http://www.amazon.com/exec/obidos/
ISBN=1562058576/listensoftwareso/";
links[2]=new String();
links[2].value="http://www.amazon.com/exec/obidos/
ISBN=076454621X/listensoftwareso/";
links[3]=new String();
links[3].value="http://www.amazon.com/exec/obidos/
ISBN=0735700494/listensoftwareso/";
links[4]=new String();
links[4].value="http://www.amazon.com/exec/obidos/
ISBN=B00004GP3J/listensoftwareso/";
frames=0;
function animateImages()
{
   document.image_placeholder.src=images[frames].src;
     book_link.href=links[frames].value;
   frames=(frames+1)%5;
   timeout_id=setTimeout("animateImages()",2000);
}
</script>
</head>
<body bgcolor="white" onLoad="animateImages();">
<a href="javascript:0" name="book_link"><img src="3ds_1.gif" name="image_placeholder" border="0"></a>
</body>
</html>

You might also like...

Comments

David Nishimoto NishiSoft provides Part I of the Information Technology Project collaboration. Sign up and list your IT project tasks, assign task too friends, and get percent complete task. Part will include a wo...

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Weeks of coding can save you hours of planning.”