Closed Thread Icon

Preserved Topic: show/hide layers in different frame?! (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=17858" title="Pages that link to Preserved Topic: show/hide layers in different frame?! (Page 1 of 1)" rel="nofollow" >Preserved Topic: show/hide layers in different frame?! <span class="small">(Page 1 of 1)</span>\

 
mario
Nervous Wreck (II) Inmate

From: germany
Insane since: Sep 2000

posted posted 09-18-2000 12:47

i´m trying to show /hide layers in a different frame for a navigation.
how do i handle the remote funktion?
this is the script i use so far.

var doAll = (document.all!=null)
var isIE = false;
var isNA = false;
var DivTop;
if(navigator.appName == "Netscape"){
isNA = true;
DivTop = '0px';
}
else{
isIE = true;
DivTop = '20px';
}
function hideAll(){

hideElement("a");
hideElement("b");
hideElement("c");
hideElement("d");
hideElement("e");
hideElement("f");
hideElement("g");


}

function showOne(id){
hideAll();
showElement(id);
}

function getCSSPElement(id) {
// Get the element
if (doAll)
return document.all[id]
else
return document.layers[id]
}

function showElement(id) {

var pEl = getCSSPElement(id)
if (pEl != null)
if (doAll){
pEl.style.visibility = "visible"
pEl.style.top = DivTop
}
else{
pEl.visibility = "show"
pEl.top = DivTop
}
}

function hideElement(id) {
var pEl = getCSSPElement(id)
if (pEl != null)
if (doAll)
pEl.style.visibility = "hidden"
else
pEl.visibility = "hide"
}

onclick="javaScript:showOne('g')

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 09-18-2000 15:34

I am pretty sure that DHTML, or more specifically javascript does not function across frames.

Since tables can do everything that frames does to some extent, it might be a better idea to use an XSSI type of navigation. Javascript would then function correctly across all of the elements.

Das
Maniac (V) Inmate

From: Houston(ish) Texas
Insane since: Jul 2000

posted posted 09-18-2000 17:54

To access another frame in JS, use:
parent.framename.document
where you would normally use:
document

This assumes you're only one level 'deep'. Parent refers to the frameset containing the frame you're 'in' at the moment, and you can specify any named frame from that frameset.

Example:
Frameset
Frame 'navbar'
Frame 'content'
/Frameset

To have Javascript in 'navbar' refer to something in 'content', you would use:
parent.content.document...

mario
Nervous Wreck (II) Inmate

From: germany
Insane since: Sep 2000

posted posted 09-19-2000 08:48

thanks guys das`suggestion works fine in ie
have to work on nn though.
talkto you later.

« BackwardsOnwards »

Show Forum Drop Down Menu