Parkpre Posted August 23, 2006 Share Posted August 23, 2006 hello peoplehow would i go about making the images within this script links? <script LANGUAGE="JavaScript">var theImages = new Array() theImages[0] = 'photo1.jpg'theImages[1] = 'photo2.jpg'theImages[2] = 'photo3.jpg'theImages[3] = 'photo4.jpg'var j = 0var p = theImages.length;var preBuffer = new Array()for (i = 0; i < p; i++){ preBuffer[i] = new Image() preBuffer[i].src = theImages[i]}var whichImage = Math.round(Math.random()*(p-1));function showImage(){document.write('<img src="'+theImages[whichImage]+'">');}</script> the code is a random image thingy, thank you! Link to comment Share on other sites More sharing options...
aspnetguy Posted August 23, 2006 Share Posted August 23, 2006 change this line document.write('<img src="'+theImages[whichImage]+'">'); to document.write('<a href="yoururl"><img src="'+theImages[whichImage]+'" border="0"></a>'); Link to comment Share on other sites More sharing options...
Parkpre Posted August 23, 2006 Author Share Posted August 23, 2006 cheers m8y! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now