Matt696969
03-26-2003, 03:00 PM
Can someone please sent all the html and javascript required to get a random image with a hyperlink ou it. I have been trying to find it for ages and cannot.:(
Thank You!:)
Thank You!:)
|
Click to See Complete Forum and Search --> : Random Images with hyperlinks Matt696969 03-26-2003, 03:00 PM Can someone please sent all the html and javascript required to get a random image with a hyperlink ou it. I have been trying to find it for ages and cannot.:( Thank You!:) khalidali63 03-26-2003, 03:18 PM Put all of the images you want to use in one directory, then create an array of images url as well as the relative url at the load time. var imageArray = new Array( new Array("image1.gif","http://www.netscape.net") ); Then get a randome number that is not greater then the array length var rand = Math.randome() * imageArray.length; now create image object if(document.images){ var img = new Image(); img.src = imageArray[rand][0]; var url = imageArray[rand][1]; } I hope this helps Cheers Khalid BTW Nobody here gets paid for or obliged to write complete solutions for any one(you may find people willing to go extra mile though).This and all other sites of the sort are only for developers to get help when tey get stuck at an issue. webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved. |