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

Re: [ydn-javascript] Re: Multiple menus on one page best practices

Expand Messages
  • Todd Kloots
    Can you provide the URL to the page that is exhibiting the problem? If you don t feel comfortable sending it to the list, feel free to contact me directly.
    Message 1 of 8 , Apr 30, 2008
    • 0 Attachment
      Can you provide the URL to the page that is exhibiting the problem? If
      you don't feel comfortable sending it to the list, feel free to contact
      me directly.

      illiphilli wrote:
      >
      > Furthermore, if I don't try to swap the menuitems out, and just apply
      > a regular, non-changing menu, everything seems to work fine. I think
      > something is getting hung up on clearContents() or something...
      > giving my head a run for it's money :)
      >
      > --- In ydn-javascript@yahoogroups.com
      > <mailto:ydn-javascript%40yahoogroups.com>, "illiphilli" <phillip@...>
      > wrote:
      > >
      > > Ah, it's because I have 2 menu's on the same page. I am also using a
      > > menubar, and the code looks like:
      > >
      > > YAHOO.util.Event.onContentReady("flyoutmenu", function () {
      > > var flyoutBar = new YAHOO.widget.MenuBar(
      > > "flyoutmenu",
      > > {
      > > position: "static",
      > > hidedelay: 750,
      > > lazyload: true,
      > > autosubmenudisplay: true
      > > }
      > > );
      > >
      > >
      > > flyoutBar.render();
      > > });
      > >
      > > I'm trying to track down now where the conflict actually is...
      > >
      > >
      > > --- In ydn-javascript@yahoogroups.com
      > <mailto:ydn-javascript%40yahoogroups.com>, "illiphilli" <phillip@> wrote:
      > > >
      > > > OK, what gives? Everything appears to be working fine, except
      > > hovering
      > > > over the menus now causes them to disappear. I have multiple triggers
      > > > that, when hovered, set the context of the menu to itself, and map a
      > > > corresponding array to the menu items. The arrays get built on the
      > > page
      > > > load, and are visible in the DOM. This code swaps out the items fine,
      > > > but can't be hovered of clicked:
      > > >
      > > > eXp.containerModuleMenus = function () {
      > > > var E =YAHOO.util.Event,
      > > > D =YAHOO.util.Dom;
      > > >
      > > > var triggers =
      > > > YAHOO.util.Dom.getElementsByClassName("modulemenutrigger");
      > > >
      > > > var containermenu = new
      > > > YAHOO.widget.Menu("containermodulemenu", {
      > > > position: "dynamic",
      > > > clicktohide: true,
      > > > classname: "containermenu",
      > > > hidedelay: 350,
      > > > fixedcenter: false
      > > > });
      > > >
      > > > containermenu.render(document.body);
      > > >
      > > > YAHOO.util.Event.addListener(triggers, "mouseover",
      > > > function(e){
      > > > containermenu.hide();
      > > > var el = E.getTarget(e);
      > > > var items = YAHOO.expadminmenus[el.id];
      > > >
      > > > containermenu.cfg.setProperty("context",[el,"tl","tr"]);
      > > > containermenu.clearContent();
      > > > containermenu.addItems(items);
      > > > containermenu.setItemGroupTitle("For this
      > > > "+el.getAttribute("rel"), 0);
      > > > containermenu.render();
      > > > containermenu.show();
      > > > });
      > > >
      > > > }();
      > > >
      > > >
      > > > The array in the DOM looks like this:
      > > >
      > > > YAHOO.expadminmenus["textmodule8"] = [
      > > > {"text":"Move Module Up","classname":"rankup"},
      > > > {"text":"Move Module Down","classname":"rankdown"},
      > > > {"text":"User Permissions","classname":"userperms"},
      > > > {"text":"Group Permissions","classname":"groupperms"},
      > > > {"text":"Configure View","classname":"configview"},
      > > > {"text":"Remove Module","classname":"deletemod"}
      > > > ];
      > > >
      > > > The trigger html looks like:
      > > >
      > > > <a id="textmodule8" class="modulemenutrigger" href="#" rel="Text
      > > > Module"> </a>
      > > >
      > > >
      > > >
      > > > Any pointers here are greatly appreciated
      > > >
      > >
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.