jquery fx: Closes #3219. jQuery.fn.toggle can accept a boolean argument indicating show/hide.

This commit is contained in:
Ariel Flesler 2008-12-25 20:13:42 +00:00
parent 0a8f96ac3d
commit 654d946ead
2 changed files with 16 additions and 6 deletions

View file

@ -155,13 +155,20 @@ test("stop(clearQueue, gotoEnd)", function() {
});
test("toggle()", function() {
expect(3);
expect(6);
var x = jQuery("#foo");
ok( x.is(":visible"), "is visible" );
x.toggle();
ok( x.is(":hidden"), "is hidden" );
x.toggle();
ok( x.is(":visible"), "is visible again" );
x.toggle(true);
ok( x.is(":visible"), "is visible" );
x.toggle(false);
ok( x.is(":hidden"), "is hidden" );
x.toggle(true);
ok( x.is(":visible"), "is visible again" );
});
var visible = {