View Full Version : Textual tool script question (between frames)

11-26-2005, 07:14 PM

I am using this script and manage to make it work in one frame. But how do I do to make it work in 2 frames? Say that I move the mouse over a link in "frame A", how do I make the text appear somewhere in "frame B"?

11-26-2005, 10:35 PM
Make up a frameset page, something like so:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<frameset cols="50%,50%">
<frame name="left" src="text1.htm">
<frame name="right" src="text2.htm">

Save it as top.htm or something.

Now, on text1.htm, make it a regular HTML page and put everything from step 1 and the first part of step 2 from the demo of this script on it.

Make these changes to the script in the 'function changetext(whichcontent)' (additions red):

function changetext(whichcontent){

if (document.all||document.getElementById){
cross_el=document.getElementById? parent.right.document.getElementById("descriptions"):parent.right.document.all.descriptions
cross_el.innerHTML='<font face="Verdana"><small>'+whichcontent+'<font></small>'
else if (document.layers){
parent.right.document.d1.document.d2.document.write('<font face="Verdana"><small>'+whichcontent+'</small></font>')


where 'right' is the name of the target frame as it is in my demo frameset at the top of this post.

Finally, put the code from step 2 second part on text2.htm. Put all three files in the same directory, open up top.htm in your browser and you are off to the races!