Solved

Change images in two different frames?

Posted on 2000-03-25
13
167 Views
Last Modified: 2010-04-09
I have a nav button in one frame,"right", and I want to change the html pages in two different frames,('middle' and 'left'). It seems to work in IE. but only changes the first URL (from the rollover) in Netscape? Here is the html code;

<ahref="news.html" onMouseOut="MM_swapImgRestore() onMouseOver="MM_swapImage('document.Image 11','document.Image 11','images/nav1b_.gif','#953832186000'," target="middle"><imagname="Image 11" border="0" src="images/nav1a_.gif" width="116" height="30" onMouseDown="MM_goToURL('parent.frames[\'left\']','movie2.html');return document.MM_returnValue"></a>

 thanks in advance.
0
Comment
Question by:douganfarms
  • 5
  • 3
  • 3
  • +2
13 Comments
 
LVL 3

Expert Comment

by:MHQ
ID: 2657414
hmmm... I am confused...
The title of this question is about changing images in two diffrent frames. But the question is about chnging the page viewd in the frames... which is it that you need help with?
0
 

Expert Comment

by:Deathead
ID: 2657525
to answer your question, Netscape does not handle MouseDowns on images...
Put the code in the onClick of the <a href> tag and it should work fine...
<a href="news.html"
onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('document.Image 11','document.Image 11','images/nav1b_.gif','#953832186000',"
onClick="MM_goToURL('parent.frames[\'left\']','movie2.html');return document.MM_returnValue"
target="middle">
<imagname="Image 11" border="0" src="images/nav1a_.gif" width="116" height="30"></a>
0
 
LVL 3

Expert Comment

by:davlun20080
ID: 2657580
it seems you are using dreamweaver to code so I punched out something similar in dreamweaver... but mine looks different.  I could see one scenario where you have a different version of DW, a second where you have set your behaviors to only support ie, or three you are trying to use their scripts without having the proper syntax (which will give unpredictable results.

The code for me was as followed, to change an image in left and middle on mouseover in right and to change right onMouseDown.  I manually added the swapImageRestore on the onMouseDown so that the images will change back before the new page is loaded in right, delete if you want to. Code:
<a href="news.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('parent.frames[\'left\'].document.image1','parent.frames[\'left\'].document.image1','images/testimage2.gif','parent.frames[\'middle\'].document.image3','parent.frames[\'middle\'].document.image3','images/testimage4.gif','#954037805230')" onMouseDown="MM_goToURL('parent.frames[\'right\']','new.htm'); MM_swapImgRestore();return document.MM_returnValue">Click
Here</a>
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 3

Expert Comment

by:davlun20080
ID: 2657581
and it works in both IE4 and ns4.7
0
 

Author Comment

by:douganfarms
ID: 2665824
Deathead, I tried your code. which looks like it should work, but it doesn't? If the "onCLick" comand is infront of the swapImgRestore, then the swap image doesn't work, and if it is after it doesn't change the html page in the "left" frame.( This is in Netscape 4.0).

And davlun20080, you misunderstood my question. I have a nav bar in frome"right" where there are rollovers, and I want to change the html pages, in frames "middle" and "left" on one single click? It works in IE 4.5 for Mac, but doesn't work in Netscape? Any one have any Ideas? I'm increasing the points to 200. Thanks, again.
0
 

Author Comment

by:douganfarms
ID: 2665827
Adjusted points from 100 to 200
0
 

Accepted Solution

by:
mas11 earned 200 total points
ID: 2668484
Perhaps something like this is the answer to your question:

<SCRIPT LANGUAGE="JavaScript">
<!--
function jump(URL1,URL2) {
      parent.frames[1].location.href=URL1;
      parent.frames[2].location.href=URL2;
}
//-->
</SCRIPT>
<A HREF="javascript:jump('nav2.htm','htm_edit.htm')" onMouseOut="MM_swapImgRestore() onMouseOver="MM_swapImage('document.Image 11','document.Image 11','images/nav1b_.gif','#953832186000'," target="middle"><imagname="Image 11" border="0" src="images/nav1a_.gif" width="116" height="30"></A>

MS
0
 
LVL 3

Expert Comment

by:davlun20080
ID: 2669508
Why don't you post your code, so I can work through.  If possible give me framset and simple page for each so I can test as you will be implementing.

davlun
0
 

Author Comment

by:douganfarms
ID: 2671824
mas11, I only see one frame change? Do I just repeat the <A HREF="jumpscript:jump( ) with the second change? Maybe I'm not following?
0
 

Expert Comment

by:mas11
ID: 2672227
you'll have to change frame numbers (or names) in the function and need to pass both filenames to the function in the link, example with names following:

<SCRIPT LANGUAGE="JavaScript">
<!--
function jump(URL1,URL2) {
parent.name1.location.href=URL1;
parent.name2.location.href=URL2;
}
//-->
</SCRIPT>
<A HREF="javascript:jump('html_for_name1.html','html_for_name2.html')" onMouseOut="MM_swapImgRestore() onMouseOver="MM_swapImage('document.Image 11','document.Image 11','images/nav1b_.gif','#953832186000'," target="middle"><imagname="Image 11" border="0" src="images/nav1a_.gif" width="116" height="30"></A>

now just change name1 and name2 in the function and change for every link html_for_name1.html html_for_name2.html
to your names

if you pass me your code i could implement it

MS
0
 

Expert Comment

by:mas11
ID: 2672240
addition:

the text between <SCRIPT LANGUAGE="JavaScript"> and //--> goes in the head section

MS
0
 

Author Comment

by:douganfarms
ID: 2685584
Sorry it's taken so long to get back to this, mas11's jump script works, but in a kind of back door way,So if I can I'd like to award 100 points to mas11.

Deathhead was right that netscape doesn't handel the on mouse down comand, award him 50points.

But the answere goes to the tech support at macromedia,dreamweaver. The "onClick" command and the "goToURL" command are mutualy exclusive so you can't change two pages in two frames with one "onClick" and one "goToURL" you have to use the # sign in the link, and have two "goToURL"s targeting different frames. This works in Netscape, and IE. Thanks everyone for your help.
PS. the judges will have to sort out these points awards.
0
 

Author Comment

by:douganfarms
ID: 2685588
Please award mas11 100 points, and deathhead, 50 points
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question