Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
eff56887
Commit
eff56887
authored
Sep 07, 2006
by
Jörn Zaefferer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modified test for wrap(String), added test for toggle(fn, fn)
parent
acf10223
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
event.js
src/event/event.js
+7
-0
jquery.js
src/jquery/jquery.js
+7
-2
No files found.
src/event/event.js
View file @
eff56887
...
@@ -16,6 +16,13 @@ jQuery.fn.extend({
...
@@ -16,6 +16,13 @@ jQuery.fn.extend({
* $(this).removeClass("selected");
* $(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
* @name toggle
* @type jQuery
* @type jQuery
* @param Function even The function to execute on every even click.
* @param Function even The function to execute on every even click.
...
...
src/jquery/jquery.js
View file @
eff56887
...
@@ -577,9 +577,14 @@ jQuery.fn = jQuery.prototype = {
...
@@ -577,9 +577,14 @@ jQuery.fn = jQuery.prototype = {
* @result <div class='wrap'><p>Test Paragraph.</p></div>
* @result <div class='wrap'><p>Test Paragraph.</p></div>
*
*
* @test var defaultText = 'Try them out:'
* @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' );
* 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
* @name wrap
* @type jQuery
* @type jQuery
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment