i've created a class specifically designed to add all the events needed for menus. you can find it here YADDM <http://mootools.net/forge/p/yaddm>. note that it comes with no effects so you need to supply them to the constructor
2010/6/29 Fábio M. Costa <[email protected]> > Whats the event? > Is it something related to mouseenter/mouseleave? > > > -- > Fábio Miranda Costa > Solucione Sistemas > Engenheiro de interfaces > Twitter: fabiomiranda > http://solucione.info > > > > On Tue, Jun 29, 2010 at 6:01 AM, chone <[email protected]> wrote: > >> try to add event listener to LI element, >> and prevent browser default event to A element? >> >> 2010/6/29 stratboy <[email protected]> >> >> Hi! I always have a tedious issue when adding events to menus. >>> Obviously, I always have links inside <li> elements. A often need to >>> attach events to the <li> elements insted of <a>. The problem is that >>> this way, e.target is always == to the <a> elem., not to <li>, because >>> of capture phase, I guess, so I always have to do something like this: >>> >>> var t = ($(e.target).match('li')) ? $(e.target) : $ >>> (e.target).getParent('li'); >>> >>> Nothing very bad, but, I was wondering.. Is there a way to stop >>> capture instead of bubbling, so I get directly the <li> event? >>> >>> Thanks >> >> >> > -- Arieh Glazer אריה גלזר 052-5348-561 5561
