Hi,
> Ok, apart from a different name, that is the same $else method. But what
> happens if you do something like this:
>
> $()
> .filter()
> .filter()
> .doStuff()
> .invert()
> .doOtherStuff()
> .invert()
> doMoreStuff();
That is very simple: the second invert() inverts the set that the first
invert() has returned. To do what you might have thought about you need to
use end():
$()
.filter()
.filter()
.doStuff()
.invert()
.doOtherStuff()
.end()
.invert()
doMoreStuff();
If course the invert()-function can not guess the indentation of your code.
Actually I think, that else() or otherwise() may be better names for it. For
me invert() sounds like a fx-function that swaps the foreground- and the
background-color.
Christof
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/