...

View Full Version : Other Random Image Script - adaptations



Bethlou
10-21-2010, 10:25 PM
Hi,

I have just found the Random Image Script which seems great.

What I was wondering was if it was possible to add further bits to it (either in the script or via css, not sure how)

1. I would like to be able to add an 'alt' tag to the images, so whilst on the webpage and the user hovers over the picture, the title appears.

2. Where the user clicks on the photo and it takes them to a webpage, can this be to a new window, so basically, target_blank?

Many thanks in advance

Beth

Bethlou
10-21-2010, 11:47 PM
sorry, meant to give the link;

http://www.javascriptkit.com/script/cut118.shtml

The code is:<script language="JavaScript">
<!--

/*
Random Image Script- By JavaScript Kit (http://www.javascriptkit.com)
Over 400+ free JavaScripts here!
Keep this notice intact please
*/

function random_imglink(){
var myimages=new Array()
//specify random images below. You can have as many as you wish
myimages[1]="image1.gif"
myimages[2]="image2.gif"
myimages[3]="image3.gif"
myimages[4]="image4.gif"
myimages[5]="image5.gif"
myimages[6]="image6.gif"

//specify corresponding links below
var imagelinks=new Array()
imagelinks[1]="http://www.javascriptkit.com/script/cut118.shtml"
imagelinks[2]="http://www.javascriptkit.com/script/cut118.shtml"
imagelinks[3]="http://www.javascriptkit.com/script/cut118.shtml"
imagelinks[4]="http://www.javascriptkit.com/script/cut118.shtml"
imagelinks[5]="http://www.javascriptkit.com/script/cut118.shtml"


var ry=Math.floor(Math.random()*myimages.length)
if (ry==0)
ry=1
document.write('<a href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" border=0></a>')
}
random_imglink()//-->
</script>

<p align="center">This free script provided by<br />
<a href="http://javascriptkit.com">JavaScript
Kit</a></p>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum