Its not to be added to each li its to be added to the hole container from
the tree.
$(container).addEvent('click:relay(a)', function(){
//code
});
read about it more to understand what it does.
Cheers,
> *This is one of those things that should really use event delegation.
> >
> > http://mootools.net/docs/more/Element/Element.Delegation
> >
> > Using event delegation is more memory efficient and scales well in this
> > case. Still it is perfect if you are loading new folders and files, cause
> > you wont need to add the click event on them.
>
> hmm, i am stuck ...
>
> <li>
> <a href="...">Node</a>
> <ul>
> <li>...</li>
>
> atm the click/enter and leave events are bound to the 1st <a> and do
> work perfect.
>
> If i add the click to the <li> delegating it to a (click:relay(a)) it
> will delegate the click to the whole content of the clicked <li>.
>
> I tried a:first-child but same effect, the click seems still to be
> captured for the whole <li>.
>
> Do you have any example of what you think it should be done?
>
--
Fábio Miranda Costa
Solucione Sistemas
Engenheiro de interfaces