Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Frames and Javaacrip Variables

Status
Not open for further replies.

NikP

Programmer
Mar 1, 2001
18
GB
Hi guys...wondering if anyone can help on this one.

I have a page call index.html which is a frameset. The two frames within it are called content.html and navigation.html.

In the navigation frame I have a title. The title changes when the user clicks in the navigation frame on a section.

What i need to be able to do is the same from the content frame namely content.html i.e when I click a subject in the content frame the title in the navigation frame changes.

I have used layers and I can get the title to change if I click on each PAGE but if I click on one section on the content and then on another in the navigation the layer does not hide and i get two layers showing...

Code

function changeTop(section)

{

parent.navigation.document.all[layerShowing].style.visibility="hidden"
parent.navigation.document.all[section].style.visibility="visible"
layerShowing=section

}

can anyone help I know its confusing! but if anyone can help it would be a great help

nik
 
because layerShowing is not a GLOBAL variable - meaning it gets re-init each time you reload (change) page

3 solutions :
- put it in an embedded file
- put it in a hidden field :
<form name=helper><input type=hidden name=layerShowing></form>
and change your function to :
parent.navigation.document.all[document.helper.layerShowing.value].style.visibility=&quot;hidden&quot;
parent.navigation.document.all[section].style.visibility=&quot;visible&quot;
document.helper.layerShowing.value=section
- put it in a hidden frame (almost the same that the hidden fieldtrick)

let me know
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top