Click to See Complete Forum and Search --> : Random Linked Image Help?


lynzriches
06-19-2003, 11:43 AM
Hi there

I'm designing a new website for the store where I work. We'd like to have a random linked image appear on the website. This I have figured out how to do, and I have figured out how to link them.

I am also using an I-Frame. The random image script is on my index file. What I'd really like to see happen is for the random image to change whenever a user clicks on a link, not just when the index file is loaded. I'd also like for the random image links to "pop-up" rather than load over top of our website. I'm sorry if this isn't making much sense, I'm new to a lot of this stuff.

Here is a link to the temporary site I am working on. Keep in mind I'm a beginner, here, so I am sure there are lots of things I'm doing wrong.

http://www3.sympatico.ca/rlriches
Is there any way to get the random images to link to a pop-up window? Can the random images change when a link on the left is clicked?

Thanks for all your help

Lyndsay

Jona
06-19-2003, 12:27 PM
I made a script like this that may be of help. (http://jona.t35.com/experiments/randImg_and_Size.html)

Jona

Khalid Ali
06-19-2003, 12:28 PM
Everything that you mentioned is totally possible.
First to display a random image ehwn a link is clicked..
create a function suppose..
function displayRandImage(){
//code here
}

then put your randomly generating image code in the function above.now in all of the links

add the following
<a href="urlHere" onclick="displayRandImage()">Click</a>

The above ,provided your random image creating code works, will display a random image whn a link is clicked.
To make that image appear in a popup

add the following lines in the function above

window.open(img.src,"popupWin");

where img.src is th value that you can get from the random image created.