Library code snippets
Rotating Images
By David Nishimoto, published on 06 May 2002
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>
Related articles
Related discussion
-
An old chestnut: Scrolling DIVs. Can I use onmouseover/onmouseout?
by Skunk (1 replies)
-
code highlighting using jquery
by pjm (1 replies)
-
Problem when using TemplateField and ImageButton
by mhuff84 (14 replies)
-
dropdownlist for country,state and city
by jack_tom (2 replies)
-
popup window in vb.net... how it's work?..
by yf2009 (6 replies)
Related podcasts
-
jQuery in ASP.NET
In this episode Chris Brandsma, Rick Strahl, Dave Ward, Bertrand Le Roy, Scott Koon, and Steven Harman discuss Microsoft's jQuery in ASP.NET announcement.This episode of the Alt.NET Podcast is brought to you by LLBLGen Pro, the most mature O/R mapper and code generator out there.Are you loo...
Events coming up
-
Oct
28
Web Standards Group (Sydney)
North Sydney, Australia
TBA
This thread is for discussions of Rotating Images.