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

Re: [ydn-javascript] 0.12.1 yuimenu - problem in mouseOver event

Expand Messages
  • Todd Kloots
    I think that you are over complicating things by creating your context menu in response to a mouseover event. The easiest to improve performance way would
    Message 1 of 6 , Jan 2, 2007
    • 0 Attachment
      I think that you are over complicating things by
      creating your context menu in response to a
      "mouseover" event. The easiest to improve performance
      way would be to use the "onAvailable" method of the
      Event utility to track when your hyperlink becomes
      available in the DOM and then instantiate your context
      menu in response. I have created an example for you:

      http://yuiblog.com/sandbox/yui/v0121/examples/menu/example02.php

      I hope that helps.

      - Todd

      --- kavithapb pujar <kavithapronet@...> wrote:

      > Hiiiiii kloots,,,
      >
      > I am using ContextMenu,,and framing the menu upon
      > mouseOver event of a hyperlink,,,
      >
      > This is the function called upon mouseOver event of
      > hyperlink,,
      >
      > function buttonMouseOver(evt, id) {
      >
      > evt = (evt) ? evt : ((window.event) ?
      > window.event : "");
      > if (evt) {
      > var target = (evt.target) ? evt.target :
      > evt.srcElement;
      > if (target.tagName == "IMG") {
      > target = target.parentNode;
      > }
      > var ele = toolsCache[id];
      > if (! ele) {
      > ele = loadMenu(id, target);
      > ele.show();
      > } else {
      > ele.show();
      > } } }
      >
      > in loadMenu() i am creating the context menu passing
      > id and target,,
      >
      >
      > loadMenu(id,target){
      > menu = new YAHOO.widget.ContextMenu(id,
      > {trigger : target});
      > menu.mouseOutEvent.subscribe(onMenuMouseOut,
      > menu, true);
      > menu.render(document.body);
      > }
      >
      > As u said in relase Notes u are focussing initially
      > upon menuitem on menuLaod,,itz directly calling
      > mouseOutEvent and menu is disappearing
      >
      > Hope you got idea about my problem,,
      >
      > In Another way,,,, is if i specify hideDelay,,then
      > submenus will go,,but still mainMenu doesn't
      > disappear
      >
      > I dont know where to submit example,,please provide
      > link to submit example so that you can have better
      > idea about my problem
      >
      > Waiting for Reply,,,,,,
      >
      > Thank You
      >
      >
      >
      > Todd Kloots <kloots@...> wrote:
      > I'd be happy to help you debug
      > this if you could
      > provide a code sample.
      >
      > Thanks.
      >
      > - Todd
      >
      > --- kavithapronet <kavithapronet@...>
      > wrote:
      >
      > > Hii all,
      > >
      > > I am using popup menu on mouse over event of yui
      > > I have problem in mouseover event in 12.1 version
      > in
      > > menu.js,,
      > >
      > > if i move mouse over menu before i move mouse
      > upon
      > > menu items,,menu
      > > disappears
      > >
      > > This problem was not there in 12.0 version,it was
      > > working fine.
      > >
      > > I am subscribing to mouseOver event and then
      > > rendering the menu
      > >
      > > menu.mouseOutEvent.subscribe(onMenuMouseOut,
      > menu,
      > > true);
      > > menu.render(document.body);
      > >
      > > Do i need to add anything more in 12.1 version?
      > >
      > > Plz reply
      > >
      > > Thank You
      > >
      > >
      > >
      > >
      > >
      > >
      > >
      > >
      > >
      > > Yahoo! Groups Links
      > >
      > > (Yahoo! ID required)
      > >
      > >
      > mailto:ydn-javascript-fullfeatured@yahoogroups.com
      > >
      > >
      > >
      > >
      > >
      > >
      >
      >
      >
      >
      >
      > Send free SMS to your Friends on Mobile from your
      > Yahoo! Messenger. Download Now!
      http://messenger.yahoo.com/download.php
    Your message has been successfully submitted and would be delivered to recipients shortly.