mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Modified test for wrap(String), added test for toggle(fn, fn)
This commit is contained in:
parent
acf102237f
commit
eff56887b1
@ -16,6 +16,13 @@ jQuery.fn.extend({
|
||||
* $(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
|
||||
* @param Function even The function to execute on every even click.
|
||||
|
9
src/jquery/jquery.js
vendored
9
src/jquery/jquery.js
vendored
@ -577,9 +577,14 @@ jQuery.fn = jQuery.prototype = {
|
||||
* @result <div class='wrap'><p>Test Paragraph.</p></div>
|
||||
*
|
||||
* @test var defaultText = 'Try them out:'
|
||||
* @test var result = $('#first').wrap('<div class="red">xx<span></span>yy</div>').text()
|
||||
* var result = $('#first').wrap('<div class="red"><span></span></div>').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:'
|
||||
* var result = $('#first').wrap('<div class="red">xx<span></span>yy</div>').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
|
||||
|
Loading…
Reference in New Issue
Block a user