I'm kind of a newb to javascript, so bear with me. I'm working on a site for a college javascript class, but I want to do a little bit more with my class site. I have a very simple slideshow set up( as a pop-up), but I want the images to be clickable and take the person to a site. Specifically, I have images for books on amazon, and I want the person to be able to click on the images and be taken to the specific page where the book is sold.
I'll post what I have, I was wondering what would be the best way to integrate it into my slideshow. Thanks in advance.
<body onblur="self.close()">
<div style="text-align: center;">
<p>If you like this site, you will love these<br />
wonderful books. Click <a href="http://www.amazon.com">here</a>
to buy.</p>
<script type="text/javascript">
var i=0;
var imageArray = new Array();
imageArray[0] = "cultOfMac.jpg";
imageArray[1] = "appleConfidential.jpg";
imageArray[2] = "insanelyGreat.jpg";
imageArray[3] = "howthemacwasmade.jpg";
function rotateImage()
{
//Creating a new Empty Array
var buffer= new Array();
if (i >= imageArray.length)
{i=0;}
buffer = new Image();
buffer.src = imageArray;
document.images["pic"].src = buffer.src;
i++;
setTimeout("rotateImage()", 2000);
}
</script>
<p>
<img src="cultOfMac.jpg"
id="pic"
name="pic"
alt="Pictures of Classic Macintosh" />
</p>
<script type="text/javascript">
rotateImage();
</script>
</div>
</body>
<!--These are my hyperlinks
Cult of Mac url= http://www.amazon.com/Cult-Mac-Paperback-Leander-Kahney/dp/1593271220/ref=pd_sim_b_4_img/102-1309812-8345769?ie=UTF8&qid=1188507280&sr=8-3
Apple confidential url = http://www.amazon.com/Apple-Confidential-2-0-Definitive-Colorful/dp/1593270100/ref=pd_sim_b_1/102-1309812-8345769?ie=UTF8&qid=1188507280&sr=8-3
Insanely Great url = http://www.amazon.com/Insanely-Great-Macintosh-Computer-Everything/dp/0140291776/ref=pd_sim_b_4/102-1309812-8345769?ie=UTF8&qid=1188507280&sr=8-3
How the mac was made url = http://www.amazon.com/Revolution-Valley-Insanely-Great-Story/dp/0596007191/ref=pd_bbs_3/102-1309812-8345769?ie=UTF8&s=books&qid=1188507280&sr=8-3
-->
</html>