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

Re: Stop redirecting to an url on Menu Click...

Expand Messages
  • zmische
    Thanks dexterwong for workaround! 2YUI-team: It seems to me that it s a bug... I ll post a note to the bug s system!
    Message 1 of 4 , Dec 10, 2006
    • 0 Attachment
      Thanks "dexterwong" for workaround!

      2YUI-team: It seems to me that it's a bug... I'll post a note to the
      bug's system!
      --- In ydn-javascript@yahoogroups.com, "dexterwong" <dexterwong@...>
      wrote:
      >
      > Hi Alexx,
      > I posted the same question after you;-)
      > In my project I'm just interested in using the menu system,
      > but I want to handle the onclick events myself. I ran into the
      > same problem. My workaround is to modify menu.js
      >
      > /*
      > Follow the URL of the item regardless of
      > whether or not the user clicked specifically
      > on the anchor element.
      > */
      >
      > //document.location = sURL;
      > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      >
      > if I comment out the above line, I get the behavior I want.
      > Clicking outside of the anchor text, won't redirect to the url.
      >
      > Later
      >
      > --- In ydn-javascript@yahoogroups.com, Alexx Alexx <zmische@> wrote:
      > >
      > > I have a menu that nodes I loaded via XHR.
      > > I created a menu, subscribe to a Click event ->
      > > Yam.tech_menu.clickEvent.subscribe(onMenuClickEvent);
      > > function onMenuClickEvent(p_sType, p_aArguments) {
      > > var oDOMEvent = p_aArguments[0];
      > > YuE.stopEvent(p_sType);
      > > YuE.stopEvent(oDOMEvent);
      > > var item_href = this.activeItem._oAnchor.href;
      > > var request = YuC.asyncRequest('GET', item_href,
      > > callback);
      > > /*
      > > XHR loading data -> no redirecting to an url required,
      > >
      > > */
      > > }
      > >
      > > My question is: why when I click on <a> element click
      > > Event is stopped -> no redirecting, but when I click
      > > on Menu Node but on <li> ( I mean area around <a> in
      > > that <li>) -> my page is redirected to an url in
      > > <a>???
      > > How I could avoid this behavior?
      > > Thanks in advance!
      > >
      > > ----------------
      > > Best regards,
      > > Alexander
      > >
      > >
      > >
      > >
      >
      ____________________________________________________________________________________
      > > Do you Yahoo!?
      > > Everyone is raving about the all-new Yahoo! Mail beta.
      > > http://new.mail.yahoo.com
      > >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.