@Paul, I know what you mean and I feel the same way while using it; I like having low-level control, especially when it comes to callbacks. The extension is just additional layer of simplicity for those who want it.
@Balazs, Thanks for your comment. I think adding any more functionality (like specifying execution order with arrays) would pretty much dispel the need for the extension in the first place; if someone needs to use ‘find’ or other methods of that type then they should definitely stick to using a callback function. Btw, that upcoming change looks promising; definitely a useful addition!
@Marko Simic, maybe you could expand your argument?
]]>After a bit digging I’ve found the original discussion where this thing came up, there were some other interesting solutions for this:
http://groups.google.com/group/jquery-dev/msg/727536a1f11c5921
http://groups.google.com/group/jquery-dev/msg/6611968e3dfde574
http://groups.google.com/group/jquery-dev/msg/c0a13ce5067ab784
But I think yours pretty much beats beats them, the only problem I think is that you can’t specify the order of execution of the commands, so you can’t use `find` or anything that relies on it. A simple solution would be if you could (optionally) wrap the objects in an array, though it might be a bit overkill.
And watch out for the next release as it looks like there will be some important changes in the event handling code: http://dev.jquery.com/changeset/6344
]]>My only reservation is that it feels like it breaks some of the basic concepts of jQuery. On of the big rules is that you don’t pass functions to be called in as strings. But since this rule is broken for event type, maybe this would just work along side it.
Keep up the great work!
]]>Anyways, I looked through your JS code a bit, this is really just short cut on top regular jQuery and passing anonymous functions.
So this:
$('a').bind('click.namespace', { addClass: 'clicked', animate: [{fontSize: '+=2px'}, 300] }); |
instead of:
$('a').bind('click.namespace',function(e) { $(this).addClass('clicked').animate({fontsize:'+=2px'},300)}); |
I don’t really see the advantages, readability isn’t even really that improved. IMHO.
]]>