"These kids and their javascript ignorance."
Thanks guys. I'd done it like Piotr mentioned, and then tried it when
constructing an element without even thinking about all the dots and
how that wouldn't make any sense.
On Oct 20, 2009, at 3:30 PM, Aaron Newton wrote:
var events = {};
events[this.options.labelEvent] = this.show.bind(this, index);
new Element('div', { events: events });
you can't use dot notation or variable substitution in object
literal notation...
On Tue, Oct 20, 2009 at 1:42 PM, Piotr Zalewa <[email protected]>
wrote:
This is not the way you setup an object parameter (example:
http://mooshell.net/yzLmw/)
If you want to assign dynamic event do it after creation of Element
new Element('div').addEvent( this.options.labelEvent:
this.show.bind(this, index) );
--
London, UK