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

Re: [ydn-javascript] Attaching Objects to MenuItems

Expand Messages
  • Todd Kloots
    rxhector2k5 - Yes, you can show/hide a Panel in response to MenuItem events. To launch a YUI Panel, you would subscribe to the desired Custom Event
    Message 1 of 3 , Oct 31, 2006
    • 0 Attachment
      "rxhector2k5" -

      Yes, you can show/hide a Panel in response to MenuItem
      events. To launch a YUI Panel, you would subscribe to
      the desired Custom Event (mouseOver, clickEvent, etc.)
      and then create/show/hide the Panel inside the body of
      your event handlers.

      For Tooltip, you'd set the Tooltip's "context"
      configuration property to the menu item's DOM element.
      Something like this:

      var myTooltip = new YAHOO.widget.Tooltip("myTooltip",
      {
      context:oMenuItem.element,
      text:"You have hovered over myContextEl.",
      showDelay:500 } );

      As you can see in the above element, you can get a
      reference back to the item's DOM via the "element"
      property.

      Lastly, Menu's "addItem" and "insertItem" methods will
      return you a reference to the item that was added.
      You can use that reference to subscribe to the item's
      Custom Events. You can also retrieve a reference to
      an item via the "getItem" or "getItemGroups" methods.

      I hope that helps you with you project.

      - Todd


      --- rxhector2k5 <rxhector2k5@...> wrote:

      > Hey guys, I think this is awesome stuff, but Im a
      > PHP guy and never
      > had any luck with javascript. SO here's what I need
      > to do. I would
      > like to get tool tips to work for my MenuBar
      > MenuItems - and I would
      > like to get a panel to open for some menuitems - do
      > i create the
      > tooltips and panels and launch them by subscribing
      > the menubaritem to
      > a mouseover event?
      >
      > I figured out to create menuitems and add them to a
      > menubar
      > ex
      >
      > aItem = new YAHOO.widget.MenuBarItem("Home" ,
      > {url:"<?php echo
      > SITE_ADDR; ?>"} );
      > oMenuBar.addItem(aItem);
      >
      > how do extract menubar items objects if they are
      > created like this
      >
      > oMenuBar.addItem(= new
      > YAHOO.widget.MenuBarItem("Home" , {url:"<?php
      > echo SITE_ADDR; ?>"} ));
      >
      > ummmm...
      >
      > thats about it for now.
      >
      > thanks
      >
      >
      >
      >
      >
      > Yahoo! Groups Links
      >
      > (Yahoo! ID required)
      >
      > mailto:ydn-javascript-fullfeatured@yahoogroups.com
      >
      >
      >
      >
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.