John Resig schrieb:
> Although, going back through his code - I really like what he did. He
> made it such that you no longer had to use anonymous function wrappers
> - which I really like.
Good point. That was the part of my solution I didn't like for myself.
> It'd be really cool to be able to do:
>
> $("#foo")
> .find("div")
> .click()
> .filter(".someclass")
> .addClass("test")
> .else()
> .addClass("someclass")
> .end()
> .end();
>
> It looks like it also needs to be ported to 1.0.1. The code is here,
> for reference:
> http://dmlair.com/jquery/jqIfElse/
>
With that ability, the dt/dd example could be rewritten to this (almost,
can't use else):
$('#faq').find('dd').hide().end().find('dt').click(function() {
$(this).next().filter(':visible')
.slideUp()
.else()
.slideDown();
});
I really like that. I'll take a look at his code and try to port it.
-- Jörn
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/