PDA

View Full Version : OnClick to change an image w/mouseover?


americanqu33r
10-04-2002, 05:01 AM
http://www.posterboy.org/productions/indexx.html

I'm working on getting my design site back up and I'm not too experienced with Javascript and I was wondering if anyone could help me by looking at that top frame. When you mouseover a button it changes. But I would also like it so when you click it to go to the page the biix box to the right changes from http://www.posterboy.org/productions/img/home-header.png to http://www.posterboy.org/productions/img/portfolio-header.png, http://www.posterboy.org/productions/img/contactus-header.png etc.

I assume it's going to take the onClick command. But it's all very confusing. Any help would be appreciated!

Shan

chrismiceli
10-04-2002, 05:33 AM
i see what you are saying all the way until you say biix box????

americanqu33r
10-04-2002, 05:35 AM
I think I meant to say "big box".

adios
10-04-2002, 05:59 AM
That is a big box.

More than one way to do this; here's one - put this in top_frame.html:

function set_imgbox(img) {
document['img-box'].src = img;
}

Add the various header images to your preloader. In each 'bot_frame' file, do:

<script type="text/javascript" language="javascript">

if (parent.top_frame)
parent.top_frame.set_imgbox('header_IMG_url');

</script>

...with the appropriate image. This will insure the header images stay in sync with the main display pages.

americanqu33r
10-04-2002, 06:14 AM
YAY!

Thank you so much it worked!

Shan