That code is passing Event#element an Element object; it doesn't
accept Elements, it accepts Events (the object passed into an event

I don't know that I understand what you're trying to do and what the
problem is.  Can you post a full, self-contained, but minimalist

Separately:  Couldn't the dimming/undimming be handled using a
CSS :hover class, rather than JavaScript?

T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available

On Jan 25, 12:58 pm, Geoffroy Gomet <geoffroy.go...@gmail.com> wrote:
> hello,
> My script observe an event (mouseover) and the opposite event
> (mouseout) of a div with an id.
> I want an event(dimming the opacity of an image in the div that's
> observed) to be triggered onmouseover and the opposite(show back the
> image at full alpha) onmouseout.
> the problem is when I hover the image, the event generated is cached
> (as the image s in the div) and the dimming appens again, what I
> obviously don't want.
> How can I observe a div, but not the contained blocks?
> Should do something like:
>   $('mydiv').descendants.each(function(e){
>     var el = Event.element(e);
>     el.observe('mouseover', Event.stop(e));
>     el.observe('mouseout', Event.stop(e));
>   })
> or is it a way to write, "this div but not the contained blocks" that
> would be straightforward(er)?
> Thnaks in advance.
> Geoffroy Gomet
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 
For more options, visit this group at 

Reply via email to