> I thought of with a single-chain version but it (ab)uses .pushStack which is
> marked @private.
When writing plugins you're fully encouraged to use the @private
methods - that's what they're there for. I'm working to document them
better for plugin authors, but you should definitely feel free to use
the @private methods.
In reality, however, what you're trying to achieve is simply the
toggling of two classes - reducing your total function to:
jQuery.fn.swapClass = function( c1, c2 ) {
return this.toggleClass( c1 ).toggleClass( c2 );
};
Which (should) have duplicate results.
--John
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/