prototype gives you those abstracted static methods (like Event.element() and Event.positionY and positionX), which you can use in a cross-browser manner... and then you still have access the original (browser native) Event object if you need it.
On 6/15/06, Sam Rowe <[EMAIL PROTECTED]> wrote:
On Thu, Jun 15, 2006 at 02:26:06PM -0500, Ryan Gahl wrote:
# Yea, like I said, it might not work how I originally wrote it, because
# you're not using the traditional prototype-ish class or object syntax...
# here... re-write everything like this...
# taco =
# {
# init: function()
# {
# this.x = $("myelement");
# Event.observe(this.x, "click", this.jojo.bindAsEventListener (this) );
# },
#
# jojo: function(e)
# {
# alert(Event.element(e).id);
# }
# };
# Event.observe(window, "onload", taco.init );
#
# ...After I looked harder I realized your main problem isn't that scope
# thing... it's that "target" is not a valid property of IE's Event
# object... lol sorry I was so blind...
#
# so using Event.element(e).id was really all you were looking for... my
# bad!! I'm just going to leave the above code like that though so you can
# see a working example of bindAsEventListener()...
Hehe thanks for putting so much work into this, but to me it certainly
begs my original question. Any chance of making "e" work the same in
FF and IE?
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs