Yea, sorry, I forgot to put the prototype abstracted function to get the event element instead of event.srcElement (which is a browser specific variable).

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Siegfried Puchbauer
Sent: Thursday, February 02, 2006 9:51 AM
To: [email protected]
Subject: Re: [Rails-spinoffs] this pointer in Event.observe function

 

Event.element(evt).style.border = '...' does the trick for you

brgds

sigi

2006/2/2, Dirk Eschler <[EMAIL PROTECTED]>:

Am Donnerstag, 2. Februar 2006 15:29 schrieb Ryan Gahl:
> Somehow my email lost some carriage returns... code blocks should read...
>
> var myHandler = function(event)
> {
>       event.srcElement.style.border = '1px solid white';
>
> }.bindAsEventListener(this);
>
> Event.observe(imgs[i], "click", myHandler);
[..]

Hi Ryan,

thanks alot for your help. To make this work in Firefox i had to do another
event system check.

var myHandler=function(event) {
  var el = event.target || event.srcElement;
  el.style.border = '1px solid white';
}.bindAsEventListener(this);
Event.observe(imgs[i], "click", myHandler);

Just wondering, isn't the framework supposed to do this check?

--
Dirk Eschler                            zeitform Internet Dienste
mailto:[EMAIL PROTECTED]              Fraunhoferstraße 5
PGP S/MIME: http://key.zeitform.de/ap   64283 Darmstadt, Germany
Tel./Fax: +49 (0)                       http://www.zeitform.de
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs




--
Mit freundlichen Grüßen

Siegfried Puchbauer

The information transmitted in this electronic mail is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material.  Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers.

_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to