PDA

View Full Version : Help with Rollover code


Coog03
08-01-2003, 02:33 PM
Hello, Need some help with a coding problem I have.

My site is set up using two frames,the header and content.

In the header frame I have 7 images that when rolled over a fireworks menu pops up. I also have an image named TitleImg. I also have some code:
<script>
Rollover.src = parent.defImage
</script>

In the content frame I have the content and some code that goes like this.
<script language="JavaScript1.2" type="text/javascript">
parent.defImage = "images/careers.jpg"
parent.Header.location = "header.htm"
</script>

I have it so that when the user goes to a new content page the content page reloads the header and makes sure that the image named Rollover is the correct image for the section the user is in.

Every section in the site has a different image associated with it and the content page assigns the default image depending on the section the user is in.

My problem is I am not sure of the coding to make the image named Rollover change to a different image depending on which of the 7 navigation images you rollover and onmouseout go back to the defimage that is assigned in the content frame.

Any help is appreciated.

Thanks in Advance

Vincent Puglia
08-02-2003, 12:33 PM
Hi,

I'm a little confused -- Why are you reloading the header page? (I presume that is where the navigation menu is.) If you are reloading it so to change the image, you're doing too much; you only need to swap the image with something like:

in the contents page:

function rollit(aVar)
{
switch (aVar)
{
case "someString":
parent.header.defImage = "images/careers.jpg";
break;
case "string2":
....etc...
}
}

If I'm misreading your post, please explain further, provide a link, or show more code

Vinny


<body onload=rollit(someVar)>

if (parent.contextPage.location == "something.html")

Coog03
08-02-2003, 07:08 PM
The attached image should clarify a little..if you need more specific description of the problem email me. Coog03@hotmail.com