});
test("toggle()", function() {
- expect(7);
- var x = jQuery("#foo");
+ expect(9);
+ var div,
+ x = jQuery("#foo");
+
ok( x.is(":visible"), "is visible" );
x.toggle();
ok( x.is(":hidden"), "is hidden" );
ok( x.is(":hidden"), "is hidden" );
x.toggle(true);
ok( x.is(":visible"), "is visible again" );
-
+
+ div = jQuery("<div style='display:none'><div></div></div>").appendTo("#qunit-fixture");
+ x = div.find("div");
+ strictEqual( x.toggle().css( "display" ), "none", "is hidden" );
+ strictEqual( x.toggle().css( "display" ), "block", "is visible" );
+
// Ensure hide() is called when toggled (#12148)
var oldHide = jQuery.fn.hide;
jQuery.fn.hide = function() {
};
x.toggle( name === "show" );
jQuery.fn.hide = oldHide;
-
-
});
test("hide hidden elements (bug #7141)", function() {