JavaScript Between Frames - onmouseover problem!

They have: 2,390 posts

Joined: Nov 1998

Can I see this - URL?
JP

----------
The Webmaster Promotion and Resource Center.
http://www.what-next.com

They have: 7 posts

Joined: Jun 1999

To clarify my earlier question re:onmouseover In Separate Frames.

Basically I need to change an image in a different frame using the mouseover/out commands.

I used 'onmouseover="parent.depth.changedepth.src=.........
to change a file with the 'name="changedepth"' in a frame called 'depth'. (Both the frames are in the same <frameset> : although this frameset is heavily nested!?).

It works in MSIEv5.0 but not in NetscapeNavigatorv4.5

Please help!

John Pollock's picture

He has: 628 posts

Joined: Mar 1999

I don't think Netscape supports the onMouseover command in an image map, only in a plain anchor tag.

You would likely have to split the image map and create a "fake" image map with regular links to get it cross-browser. I'm not absolutely sure on it, so you might wait and see if someone else knows another way. Smiling

----------
Page Resource: http://www.pageresource.com
JavaScript City: http://www.javascriptcity.com

They have: 2,390 posts

Joined: Nov 1998

Paul emailed me and I thought I would put up an example of his problem.
Works in IE/not in N.
http://what-next.com/paul_reid/frame.htm
JP

----------
The Webmaster Promotion and Resource Center.
http://www.what-next.com

They have: 7 posts

Joined: Jun 1999

Netscape DOES support onmouseover in an image map. I have used it before and it has worked on both MSIE & Netscape. The problem has only occured now that I need it to change an image in a separate frame from the one the mouse is rolling over. It doesn't appear to be finding the 'name=.....' attribute in the other frame.

For example I'm sure the code will work if I simply used
'onmouseover="changedepth.src=.........
where changedepth is the 'name=changedepth' in the image and both the images (one the mouse rolls over & one that changes) are in the same frame.

As you will see above to navigate to the other file I've used
'onmouseover="parent.depth.changedepth.src=.........

ie parent.depth where depth is the other frame name, is not working (I think?)

Thanks

John Pollock's picture

He has: 628 posts

Joined: Mar 1999

Oops, I didn't mean to upset you, I just wasn't thinking clearly that day. Anyway, I think I figured out the problem. NS is very picky. Change the two words:

onmouseover

to:

onMouseover

I have a feeling that will fix it in NS and make it cross-browser.

----------
Page Resource: http://www.pageresource.com
JavaScript City: http://www.javascriptcity.com

They have: 2,390 posts

Joined: Nov 1998

Done! Smiling
Still at = http://what-next.com/paul_reid/frame.htm

JP

----------
The Webmaster Promotion and Resource Center.
http://www.what-next.com

They have: 7 posts

Joined: Jun 1999

Sorry John,

I honestly wasn't being narky!

I'm genuinly pleased with the time and effort people are spending on my (and other) questions.

However...... It still doesn't work!?

Could JP Stones please change this on my example he posted just to make sure it's just not me.

Much appreciation

Paul

(any other ideas John)!?

They have: 7 posts

Joined: Jun 1999

I have found the answer. If you simply put :

parent.depth.document.changedepth.src=.... it works!

Thank you both very much for your help! Hope this example is useful to someone else!!

Cheers,

Paul

They have: 2,390 posts

Joined: Nov 1998

good, glad we of help Smiling
Tell use when you get the real version up and running!
JP

----------
The Webmaster Promotion and Resource Center.
http://www.what-next.com

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.