...

View Full Version : HI GUYS! Can anyone help me with this...



Girly Geek
05-28-2008, 05:38 AM
HOW CAN I MAKE THE IMAGE LINKS -WHILE USING THE SCRIPT BELOW- POP UP IN A SEPARATE WINDOW??

I TRIED TO ADD SOME target="_blank" IN THERE BUT... THAT DOESNT WORK!
PLEASE SOMEONE! THAT MUST BE SIMPLE... BUT I CANT FIGURE IT OUT!!

THANKS,
GIRLY GEEK :)


Random Image Link
A script that loads a random image with the corresponding link. Supports unlimited images.
http://www.javascriptkit.com/script/cut144.shtml
Description: This is a robust script that loads a random image with corresponding link. You can throw in as many images into rotation as you wish.


<script language="JavaScript">
<!--

/*
Random Image Link Script- By JavaScript Kit(http://www.javascriptkit.com)
Over 200+ free JavaScripts here!
Updated: 00/04/25
*/

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"
imagelinks[2]="http://www.netscape.com"
imagelinks[3]="http://www.microsoft.com"
imagelinks[4]="http://www.dynamicdrive.com"
imagelinks[5]="http://www.freewarejava.com"
imagelinks[6]="http://www.cnn.com"

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>

rangana
05-28-2008, 05:51 AM
Have you tried it like this:


document.write('<a href='+'"'+imagelinks[ry]+'" target="_blank"'+ '><img src="'+myimages[ry]+'" border=0></a>')

Girly Geek
06-04-2008, 12:51 AM
Oh wow! It works!
Thank you so much - rangana!!

I appreciate a lot :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum