At a first glance this code is really not readable (to me at least). I
think there is too much of a good thing here (that being chainable
methods). It seems like the end goal here is to have one function be
applied to part of the jQuery object's elements and another be applied
to a different part.

Perhaps having a method *like* filter but does not trim down the
result set and accepts two methods would be the best option. Maybe
even call it 'ifelse'? This approach would also allow it to be a
plugin to make sure it is something that is useful enough to make it
into the core and would not change the behavior of any of the current
methods.

$('div').ifelse(':visible', ifCallback, elseCallback);

** Going to re-read to make sure I'm not complete off-base **

Okay ... so after re-reading I think that Jörn's first idea is the
better one than the other suggestions. My only concern is that it
changes the behavior of the is method. I still think making this its
own method is the best option.

With that said I think either modifying the is method, not method or
*preferably* adding a new method with this simple syntax will be very
useful!

--
Brandon Aaron

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to