TeamPhotoshop
Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
Forum Home Latest Posts Search Help Subscribe

ns6 problem

Page: 1 Reply
Apr 25th 2001#2306 Report
Member since: Mar 21st 2001
Posts: 50
Hi, I'm working on a project where I'm using dropdown layers. I get the javascript to work fine in almost every browser I need to. But I need to get it to work in NS6. I haven't done this before so I don't know what changes I have to make in my scripts. Could someone direct me to some good readingmaterial on this mather. It's kinda urgent!

Thanks,
Munti
Reply with Quote Reply
Apr 26th 2001#2370 Report
Member since: Mar 27th 2001
Posts: 2237
I like wsabstract.com for issues like this, they have alot of info on there both in the forums and articles.
Reply with Quote Reply
Apr 29th 2001#2545 Report
Member since: Apr 12th 2001
Posts: 27
Hi, try this code:

(goes into the head section)
[code]

//this finds the style-properties for a layer
function getObj(name, nest) {
if (document.getElementById)
return document.getElementById(name).style;
else if (document.all)
return document.all[name].style;
else if (document.layers)
if (nest != ''){
return eval('document.'+nest+'.document.layers["'+name+'"]');
}else{
return document.layers[name];
}
}

//call this to show layer
function showLayer(layerName, nest){
var x = getObj(layerName, nest);
x.visibility = "visible";
}

//call this to hide the layer
function hideLayer(layerName, nest){
var x = getObj(layerName, nest);
x.visibility = "hidden";
}



//this part is the layers in the body tag



//this is how you call the functions
<.a href="javascript:showLayer('NewsDrop','');hideLayer('NewsDrop1','');">Show layer 0



<.a href="javascript:showLayer('NewsDrop1','');hideLayer('NewsDrop','');">Show layer 1


[/code]

Works in NS4+, IE4+, NS6 & Opera 5
//Dan
Reply with Quote Reply
Page: 1 Back to top
Please login or register above to post in this forum