jQuery: The Write Less, Do More JavaScript Library

Re: show/hide/toggle: suggestion to reduce show/hide code

by Karl Swedberg-2 :: Rate this Message:

Reply to Author | View in Thread

On Nov 18, 2008, at 9:02 AM, Dylan Verheul wrote:


On Tue, Nov 18, 2008 at 14:56, Karl Swedberg <karl@...> wrote:
Not sure if toggle(cond) is the best choice, though. It's already pretty
overloaded as it is, and it can already take a string or numeric argument
for speed (e.g. 'slow'), which means you'd have to make sure that cond ===
true, not just cond == true.

Hmm, I actually checked the docs for that because that would make
.toggle an unsuitable overloader. The docs said toggle doesn't take
arguments:
http://docs.jquery.com/Effects
Outdated?

Hmmm, indeed. :) Not so much outdated as incomplete. I just went ahead and added it to the docs:


--Karl
____________
Karl Swedberg


 « Return to Thread: show/hide/toggle: suggestion to reduce show/hide code