[jQuery] show/hide/toggle: suggestion to reduce show/hide code

[jQuery] show/hide/toggle: suggestion to reduce show/hide code


I'm building a new version of an often used data entry form on our
site Waarneming.nl (int'l version Observado.org).
It struck me that I often have to write something like this:
if (cond) $(this).show() else $(this).hide();
Since jQuery is about reducing and chaining, wouldn't it be nice if I
could write it like this:
$(this).toggle(cond); // shows if cond evaluates to true, else hides
Of course a new function showhide could be made for this, but toggle
seems a likely candidate for overloading.
-Dylan