diff --git a/src/event/event.js b/src/event/event.js index eb5d731b..b273ad81 100644 --- a/src/event/event.js +++ b/src/event/event.js @@ -15,6 +15,13 @@ jQuery.fn.extend({ * },function(){ * $(this).removeClass("selected"); * }); + * + * var count = 0; + * var fn1 = function() { count++; } + * var fn2 = function() { count--; } + * var link = $('#mark'); + * link.click().toggle(fn1, fn2).click().click().click().click().click(); + * ok( count == 1, "Check for toggle(fn, fn)" ); * * @name toggle * @type jQuery diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 5b2d7469..3edc3033 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -575,11 +575,16 @@ jQuery.fn = jQuery.prototype = { * @example $("p").wrap("
"); * @before

Test Paragraph.

* @result

Test Paragraph.

+ * + * @test var defaultText = 'Try them out:' + * var result = $('#first').wrap('
').text(); + * ok( defaultText == result, 'Check for simple wrapping' ); + * ok( $('#first').parent().parent().is('.red'), 'Check if wrapper div has class "red"' ); * * @test var defaultText = 'Try them out:' - * @test var result = $('#first').wrap('
xxyy
').text() + * var result = $('#first').wrap('
xxyy
').text() * ok( 'xx' + defaultText + 'yy' == result, 'Check for wrapping' ); - * @test ok( $('#first').parent().parent().is('.red'), 'Check if wrapper div has class "red"' ); + * ok( $('#first').parent().parent().is('.red'), 'Check if wrapper div has class "red"' ); * * @name wrap * @type jQuery