That will probably give you some problems with textarea's and input
elements. I've created a patch that allows observe to handle
mouseenter and mouseleave so you can do:

$(element).observe('mouseenter', function() { alert('entered'); });
$(element).observe('mouseleave', function() { alert('left'); });

patch: http://prototype.lighthouseapp.com/projects/8886/tickets/350
demo: http://www.nickstakenburg.com/tests/enterleave/

--
Nick

On 19 sep, 14:41, Julien <[EMAIL PROTECTED]> wrote:
> Element.addMethods({
>                      onmouseenter: function(element,observer) {
>                        element = $(element);
>                        element.observe('mouseover',
>                                        function(evt,currentTarget) {
>                                          var relatedTarget = $
> (evt.relatedTarget || evt.fromElement);
>                                          if( relatedTarget!
> =currentTarget && relatedTarget.childOf(currentTarget)==false )
> observer(element);
>                                        }.bindAsEventListener({},element));
>                        return element;
>                      },
>                      onmouseleave: function(element,observer) {
>                        element = $(element);
>                        element.observe('mouseout',
>                                        function(evt,currentTarget) {
>                                          var relatedTarget = $
> (evt.relatedTarget || evt.toElement);
>                                          if(relatedTarget!
> =currentTarget &&
> relatedTarget.childOf(currentTarget)==false )observer(element);
>                                        }.bindAsEventListener({},element));
>                        return element;
>                      }
>                    });
>
> it's work
>
> On 19 sep, 13:12, Julien <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hello
>
> > I want to include dom event mouseleave and mouseenter on prototype
> > 1.6.0.2.
> > Anyone have a idea to include it ?
>
> > Thanks.
>
> > Regards,- Tekst uit oorspronkelijk bericht niet weergeven -
>
> - Tekst uit oorspronkelijk bericht weergeven -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to