hi wal5hy,
three thought on this:
1. events you observe do not act like events you assign a single
callback to. while element.onclick = function(){return false;} has the
desired effect, it won't have it when using Event.observe() because
observed events are not finished when the callback is through. this way
you can have more than one callback observing the same event.
walter is right Event.stop() will help you.
2. you have a scope problem. when popup() is called your 'this' will not
necessarily point to the anchor. it will more likely loose its scope and
point to window instead. you want to look up bindAsEventListener()[1]
it will help you.
3. instead of this
$$('a.popout').each(function(thePopout){Event.observe(thePopout,'click',popout);});
you could just use
$$('a.popout').invoke('observe', 'click', popout);
which does the same here but imho is more elegant. no error though.
cheers
/christian
[1] http://prototypejs.org/api/function/bindAsEventListener
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---