Hi all,

first of all, thank you for your answers (And yes I swear, ill never
use performantly or performant in this Group again :)).

It seems like event delegation is the way to go. So, I just looked
over the links you posted (thanks for them!), but they dont seem to do
something different than my example posted:

.....
 initListeners: function() {

                document.observe('mouseover',
this.moverListener.bindAsEventListener
(this));
                document.observe('mouseout',
this.moutListener.bindAsEventListener
(this));
        },

        moverListener: function(e) {

                elm = Event.findElement(e, '.' + this.classes);

                if(elm !== undefined) {

                        this.showToolTip(elm)
                } else return;
        },

        moutListener: function(e) {

                elm = Event.findElement(e, '.' + this.classes);
                if(elm !== undefined) {

                        this.hideTooltip(elm);
                }
        },
.....

Maybe I didnt get it, but isnt this what is meant with event
delegation or didnt I get the concept right?

PS: I tried this method with the new mouseenter/mouseleave events in
the latest prototype rc, but it just returned me the element I put the
listener on (e.g., hovering over a span in a div with id "test" didnt
get me the span or the div, but the document body). As this is the
thing that is really ment with mouseenter/mouseleave, you could never
do event delegation with mouseenter/mouseleave. Am I right here?

Greetings from Germany,
Chris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to