Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 176
  • Last Modified:

Change images in two different frames?

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
douganfarms
Asked:
douganfarms
  • 5
  • 3
  • 3
  • +2
1 Solution
 
MHQCommented:
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
 
DeatheadCommented:
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
 
davlun20080Commented:
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
davlun20080Commented:
and it works in both IE4 and ns4.7
0
 
douganfarmsAuthor Commented:
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
 
douganfarmsAuthor Commented:
Adjusted points from 100 to 200
0
 
mas11Commented:
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
 
davlun20080Commented:
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
 
douganfarmsAuthor Commented:
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
 
mas11Commented:
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
 
mas11Commented:
addition:

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

MS
0
 
douganfarmsAuthor Commented:
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
 
douganfarmsAuthor Commented:
Please award mas11 100 points, and deathhead, 50 points
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 5
  • 3
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now