I use this a time ago for events, but I haven't time to test it.
Element.addMethods(
{
on: function (element, event, func)
{
var prop = ['event' + event];
if (!element[prop]) element[prop] = [];
element[prop].push(func);
element.observe(event, element[prop].last());
return element;
},
undo: function(element, event)
{
var prop = ['event' + event];
if (element[prop])
element[prop].each(function (func)
{
element.stopObserving(event, func);
});
return element;
}
});
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype: Core" 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/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---