bind with event and parameter passing

46 views
Skip to first unread message

batman42ca

unread,
Feb 10, 2012, 2:20:51 PM2/10/12
to MooTools Users
I have what I think is a simple bind() problem.

http://jsfiddle.net/42YxB/1/

I'm trying to add an event to an element, with a bind() while passing
a parameter and being able access the event through my event handler

I've searched around but I can only find very basic examples of using
the bind() function

Sanford Whiteman

unread,
Feb 10, 2012, 2:55:25 PM2/10/12
to batman42ca
> I'm trying to add an event to an element, with a bind() while passing
> a parameter and being able access the event through my event handler

> I've searched around but I can only find very basic examples of using
> the bind() function

http://jsfiddle.net/42YxB/3/

Using 1.4.3-compat may have been causing confusion. The pattern in the
Fiddle works in both 1.3.2 and 1.4.3, but presumably due to the compat
layer trying to patch the bind() implementation to be the way it was
before 1.4's ECMAScript bind() awareness, it screws up the logic.

-- S.

batman42ca

unread,
Feb 10, 2012, 3:04:20 PM2/10/12
to MooTools Users
Thanks Sanford.

> Using 1.4.3-compat may have been causing confusion.

Using the compatibility mode was actually a mistake. I didn't realize
I was using it. So all I had to do was swap the parameters to my event
handler and turn off compatibility mode.
Reply all
Reply to author
Forward
0 new messages