Solved

Change images in two different frames?

Posted on 2000-03-25
13
164 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
 
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
HTML table 7 54
Summernote required 3 59
radio button value 3 46
CSS grid style change 2 15
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now