mm_menu and hiding recently made visible layers

Discussion in 'JavaScript' started by NoobieDoobieDo, Sep 26, 2007.

  1. #1
    I'm working with this code which sets an object to visible when clicked. Trouble is the previous object hasn't been set to hidden so they overlap each other.

    How can I get this function to hide the previous object before showing the next ?

    Thanks

    function MM_showHideLayers() { //v6.0
      var i,p,v,obj,args=MM_showHideLayers.arguments;
      for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
        if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='show')?'hidden':v; }
        obj.visibility=v; }
    
    Code (markup):
     
    NoobieDoobieDo, Sep 26, 2007 IP
  2. NoobieDoobieDo

    NoobieDoobieDo Peon

    Messages:
    1,456
    Likes Received:
    53
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I'll pay $1 right now to the person who can fix this (must be within 5 minutes)

    Paypal only
     
    NoobieDoobieDo, Sep 27, 2007 IP