1 Reply Latest reply on Sep 13, 2007 9:34 AM by Mr. Aztek

    Tweaking the code...

    Mr. Aztek Level 1
      I lifted this awesome collapsing menu script from Senocular and am now making tweaks to this. The file can be found HERE

      Two questions:

      1. I figured out how to make it so that they automatically start with a 20 pixel buffer before clicking, but I am a little lost on where to put the math in so that when they close, it closes to that 20 pixel buffer mark.

      2. If in the event that I only want the second (middle) item to expand and collapse, how do I work around that?

      "bonus" questions

      B1. I'd like to make it so that when each topic (title) is clicked on, there's an "up" state to it. I've tried making them buttons, but because they are all contained within the same movie clip, they ALL just cycle though each state rapidly upon rolling over it. Oddly enough the sub navs seem to work just fine as buttons.

      B2. Should that work, I'd want the text to change to white so that it contrasts against a darker "up" state, same thing for the subnavs (the beige "over" state used to be a deep purple--same as the text).

      I'm more concerned with the spacing than the "bonus" stuff, but any help would be greatly appreciated!
        • 1. Re: Tweaking the code...
          Mr. Aztek Level 1
          Duh. I'd finally figured out the tweak to maintain the spacing when closed.

          PositionMenusBelow = function(i){
          var menu = menus ;
          if (i < menus.length-1){
          var menu_below = menus[i+1];
          for (i=i+1; i<menus.length; i++){
          if (menus
          == menu_below){
          menus ._y = menus.masker._y = menu._y + menu.masker._height + 20;
          }else{
          var menu_above = menus[i-1];
          menus ._y = menus.masker._y = menu_above._y + menu_above.masker._height + 20;
          }
          }
          }
          }