Loading ...
Sorry, an error occurred while loading the content.

YUI menu alignment problems

Expand Messages
  • Eric P
    Hi, I have a couple dynamically placed YUI menus that do not stay aligned. Example reference: http://epierce.freeshell.org/YUImenutest.html In the example
    Message 1 of 2 , Aug 26, 2009
    • 0 Attachment
      Hi,

      I have a couple dynamically placed YUI menus that do not stay aligned.

      Example reference:
      http://epierce.freeshell.org/YUImenutest.html

      In the example there are two div blocks. Each has an expander link ('+/-') and a 'menu' link.

      The menus are aligned correctly initially, but once you expand the top div, the bottom div's menu's alignment gets
      messed up.

      I have positioned each menu with a line like the following.
      menu01.cfg.setProperty("context", ["menu01Holder", "tr", "br"]);

      And this is the only way I figured out how to get the menus to appear exactly where I want them (i.e., under the 'menu'
      link). But it appears any changes to the content above any element positioned in the manner message up the positioning.

      Thanks for any ideas.
      Eric P.

      Ps. I've learned that I can rerun the setProperty lines after a div is toggled open/close to realign the menus, but this
      is very hackish and isn't a good solution for the actual page I'm working on (which has multiple places where the DOM is
      affected).
    • Eric P
      ... I was using the Menu widget. I figured out that if I use the MenuBar, the positioning is never lost. Yay! Eric P.
      Message 2 of 2 , Sep 7, 2009
      • 0 Attachment
        Eric P wrote:
        > Hi,
        >
        > I have a couple dynamically placed YUI menus that do not stay aligned.
        >
        > Example reference:
        > http://epierce.freeshell.org/YUImenutest.html
        >
        > In the example there are two div blocks. Each has an expander link
        > ('+/-') and a 'menu' link.
        >
        > The menus are aligned correctly initially, but once you expand the top
        > div, the bottom div's menu's alignment gets messed up.
        >
        > I have positioned each menu with a line like the following.
        > menu01.cfg.setProperty("context", ["menu01Holder", "tr", "br"]);
        >
        > And this is the only way I figured out how to get the menus to appear
        > exactly where I want them (i.e., under the 'menu' link). But it appears
        > any changes to the content above any element positioned in the manner
        > message up the positioning.
        >
        > Thanks for any ideas.
        > Eric P.
        >
        > Ps. I've learned that I can rerun the setProperty lines after a div is
        > toggled open/close to realign the menus, but this is very hackish and
        > isn't a good solution for the actual page I'm working on (which has
        > multiple places where the DOM is affected).
        >

        I was using the Menu widget. I figured out that if I use the MenuBar, the positioning is never lost.

        Yay!
        Eric P.
      Your message has been successfully submitted and would be delivered to recipients shortly.