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

YUI Menu + mouseOut event

Expand Messages
  • dmitrykhudorozhkov
    Hi everyone! I have several lengthy Paragraphs ( P html elements). I ve made a YUI Menu to appear after a second after mouse cursor enters a paragraph: var
    Message 1 of 3 , Sep 3, 2007
    • 0 Attachment
      Hi everyone!

      I have several lengthy Paragraphs ("P" html elements). I've made a YUI
      Menu to appear after a second after mouse cursor enters a paragraph:

      var oMenu = new YAHOO.widget.Menu("menu_of_" + para.id, { xy:
      mouse_pos });

      To this point everything is ok.

      Now I wish Menu widget to disappear when user has moved the mouse out
      of the opened menu. BUT! Here glitches start.

      oMenu.showEvent.subscribe(function() { this.focus(); });
      oMenu.mouseOutEvent.subscribe(function() { this.hide(); });
      oMenu.render(document.body);

      oMenu.show();

      Almost every move of mouse cursor I make (even -within- the menu)
      closes the menu. Why?

      Thank you much in advance,

      - Dmitry.
    • dmitrykhudorozhkov
      Problem can be reproduced by placing the following line: oMenu.mouseOutEvent.subscribe(function() { this.hide(); }); after the line
      Message 2 of 3 , Sep 3, 2007
      • 0 Attachment
        Problem can be reproduced by placing the following line:

        oMenu.mouseOutEvent.subscribe(function() { this.hide(); });

        after the line

        oMenu.showEvent.subscribe(function() { this.focus(); });

        in the 'example02_clean.html' file ('example02' sample) of YUI
        examples, menu folder.
      • Todd Kloots
        Dmitry - The Menu library has a built-in mechanism for accomplishing the automatic hide behavior that you are looking for. Use the hidedelay configuration
        Message 3 of 3 , Sep 7, 2007
        • 0 Attachment
          Dmitry -

          The Menu library has a built-in mechanism for accomplishing the
          automatic hide behavior that you are looking for. Use the "hidedelay"
          configuration property as demonstrated in the following and many other
          of the menu examples:

          http://developer.yahoo.com/yui/examples/menu/leftnavfrommarkup_source.html

          - Todd

          dmitrykhudorozhkov wrote:
          >
          > Hi everyone!
          >
          > I have several lengthy Paragraphs ("P" html elements). I've made a YUI
          > Menu to appear after a second after mouse cursor enters a paragraph:
          >
          > var oMenu = new YAHOO.widget.Menu("menu_of_" + para.id, { xy:
          > mouse_pos });
          >
          > To this point everything is ok.
          >
          > Now I wish Menu widget to disappear when user has moved the mouse out
          > of the opened menu. BUT! Here glitches start.
          >
          > oMenu.showEvent.subscribe(function() { this.focus(); });
          > oMenu.mouseOutEvent.subscribe(function() { this.hide(); });
          > oMenu.render(document.body);
          >
          > oMenu.show();
          >
          > Almost every move of mouse cursor I make (even -within- the menu)
          > closes the menu. Why?
          >
          > Thank you much in advance,
          >
          > - Dmitry.
          >
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.