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

Re: [ydn-javascript] Is it possible to override a menu item's onmouseover event handler?

Expand Messages
  • Todd Kloots
    Miguel - You can register a mouseover and mouseout event on individual items by subscribing to those events directly on the instance. For example, here is
    Message 1 of 2 , Dec 9, 2008
      Miguel - 

      You can register a "mouseover" and "mouseout" event on individual items by subscribing to those events directly on the instance.  For example, here is some pseudo code:

      myMenu.getItem(0).subscribe("mouseover", onMenuItemMouseOver);
      myMenu.getItem(0).subscribe("mouseout", onMenuItemMouseOut);


      Alternatively, you can add a "mouseover" and "mouseout" listener to the parent Menu and the discrete MenuItem instance that was the target of the event will get passed back to your handler:

      myMenu.subscribe("mouseover", function (type, args) {

           var oEvent = p_aArgs[0],    // DOM Event
                  oMenuItem = p_aArgs[1]; // YAHOO.widget.MenuItem instance that was the target of the event

      });

      For more info:


      - Todd

      On Nov 8, 2008, at 10:57 AM, miguel wrote:

      Is it possible to register onmouseover/ onmouseout event handlers for
      individual menu items?

      Thanks


    Your message has been successfully submitted and would be delivered to recipients shortly.