function not working in Netscape

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Eric

    function not working in Netscape

    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_showHideLaye rs() {

    var i,p,v,obj,args= MM_showHideLaye rs.arguments;
    for (i=0; i<(args.length-2); i+=3) if
    ((obj=MM_findOb j(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style;
    v=(v=='show')?' visible':(v='hi de')?'hidden':v ; }
    obj.visibility= v; }
    }
  • Charles Banas

    #2
    Re: function not working in Netscape

    On 7 Aug 2003 10:08:04 -0700, Eric <eric.jacky@mar kmonitor.com> wrote:
    [color=blue]
    > 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_showHideLaye rs() {
    >
    > var i,p,v,obj,args= MM_showHideLaye rs.arguments;
    > for (i=0; i<(args.length-2); i+=3) if
    > ((obj=MM_findOb j(args[i]))!=null) { v=args[i+2];
    > if (obj.style) { obj=obj.style;
    > v=(v=='show')?' visible':(v='hi de')?'hidden':v ; }
    > obj.visibility= v; }
    > }
    >[/color]
    looks like cookie-cutter DreamWeaver code.

    no matter. in this line:

    v=(v=='show')?' visible':(v='hi de')?'hidden':v ;

    at first glance it seems it should read
    v=(v=='show')?' visible':(v=='h ide')?'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.

    --
    Charles Banas

    Comment

    Working...