Christof -
What Mark is proposing is quite different from what you're proposing.
His function physically creates the helper methods of .click(),
.val(), .href(), .title(), etc.
On a whole, I like the idea - in that it'll make writing the events
plugin painfully easy - but at the same time it'll increase the size
of the jQuery core (or, at least, not decrease the size since nothing
is being moved out of core).
--John
On 10/16/06, Christof Donat <[EMAIL PROTECTED]> wrote:
> Hi,
>
> > And for those lazy sods out there how about:
> >
> > $.quickMethods({
> > bind: ['click'],
> > attr: ['val','href','title'],
> > css: ['display','height','width']
> > });
>
> That is a really great idea :-) I think for something so usefull we should
> chose a shorter Function-name:
>
> $.fn.q = function(o) {
> for( var n in o ) this[n].apply(this,o[n]);
> return this;
> }
>
> $('.myclass').q({
> onclick: [function() {...}],
> addClass: ['asdf']
> }).filter('.myOtherClass').q({
> removeClass['asdf'],
> onmouseover(function() {...})
> });
>
> I like the idea of using onclick, onload, etc. better than always having to
> use bind(). These Event-Functions are just small wrappers around bind() which
> are - IIRC - created in a loop. I wouldn't expect that jQuery gets much
> smaller when they are removed and they are handy shortcuts.
>
> Christof
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>
--
John Resig
http://ejohn.org/
[EMAIL PROTECTED]
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/