Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Change images in two different frames?

Posted on 2000-03-25
13
Medium Priority
?
172 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 600 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

688 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