function not working in Netscape

E

Eric

I'm working with a function which is part of my navigation menu. I'm
working with hidden and visible layers and can't seem to determine why
this code will not work in netscape...I'm sure it has something to do
with the "show" and "hide" wording...any ideas?

function MM_showHideLayers() {

var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if
((obj=MM_findObj(args))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style;
v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }
}
 
C

Charles Banas

I'm working with a function which is part of my navigation menu. I'm
working with hidden and visible layers and can't seem to determine why
this code will not work in netscape...I'm sure it has something to do
with the "show" and "hide" wording...any ideas?

function MM_showHideLayers() {

var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if
((obj=MM_findObj(args))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style;
v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }
}

looks like cookie-cutter DreamWeaver code.

no matter. in this line:

v=(v=='show')?'visible':(v='hide')?'hidden':v;

at first glance it seems it should read
v=(v=='show')?'visible':(v=='hide')?'hidden':v;

because it looks syntactically equivalent to

if (v=='show') {
v='visible'; }
else if (v=='hide') {
v='hidden'; }
else { v = v; }

and (v='hide') will always evaluate true to the ternary ?: anyway.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top