I investigated on the idea a little further. A basic if/else, with 
filter() as the if-method can be achieved with this change to filter():

filter: function(t) {
        if( !this.filterStack ) this.filterStack = [];
        this.filterStack.push(t);
        return this.pushStack( ...);
}

The else method, with a dollar sign prepended, looks like this:

$else: function() {
    return this.end().not( this.filterStack.pop() );
},

With those changes, this works:
> $('#faq').find('dd').hide().end().find('dt').click(function() {
>     $(this).next().filter(':visible')
>         .slideUp()
>     .$else()
>         .slideDown();
> });
>   
Hot or not?

-- Jörn

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

Reply via email to