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
780b7983
Commit
780b7983
authored
Apr 11, 2011
by
louisremi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Group all local functions at the top of the file and add comments
parent
56ffad2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
30 deletions
+34
-30
effects.js
src/effects.js
+34
-30
No files found.
src/effects.js
View file @
780b7983
...
@@ -17,13 +17,44 @@ var elemdisplay = {},
...
@@ -17,13 +17,44 @@ var elemdisplay = {},
window
.
mozRequestAnimationFrame
||
window
.
mozRequestAnimationFrame
||
window
.
oRequestAnimationFrame
;
window
.
oRequestAnimationFrame
;
// Animations created synchronously will run synchronously
function
createFxNow
()
{
setTimeout
(
clearFxNow
,
0
);
return
(
fxNow
=
jQuery
.
now
()
);
}
function
clearFxNow
()
{
function
clearFxNow
()
{
fxNow
=
undefined
;
fxNow
=
undefined
;
}
}
function
createFxNow
()
{
// Try to restore the default display value of an element
setTimeout
(
clearFxNow
,
0
);
// fails if a display rule has been set for this element, e.g. div { display: inline; }
return
(
fxNow
=
jQuery
.
now
()
);
function
defaultDisplay
(
nodeName
)
{
if
(
!
elemdisplay
[
nodeName
]
)
{
var
elem
=
jQuery
(
"<"
+
nodeName
+
">"
).
appendTo
(
"body"
),
display
=
elem
.
css
(
"display"
);
elem
.
remove
();
if
(
display
===
"none"
||
display
===
""
)
{
display
=
"block"
;
}
elemdisplay
[
nodeName
]
=
display
;
}
return
elemdisplay
[
nodeName
];
}
// Generate parameters to create a standard animation
function
genFx
(
type
,
num
)
{
var
obj
=
{};
jQuery
.
each
(
fxAttrs
.
concat
.
apply
([],
fxAttrs
.
slice
(
0
,
num
)),
function
()
{
obj
[
this
]
=
type
;
});
return
obj
;
}
}
jQuery
.
fn
.
extend
({
jQuery
.
fn
.
extend
({
...
@@ -260,16 +291,6 @@ jQuery.fn.extend({
...
@@ -260,16 +291,6 @@ jQuery.fn.extend({
});
});
function
genFx
(
type
,
num
)
{
var
obj
=
{};
jQuery
.
each
(
fxAttrs
.
concat
.
apply
([],
fxAttrs
.
slice
(
0
,
num
)),
function
()
{
obj
[
this
]
=
type
;
});
return
obj
;
}
// Generate shortcuts for custom animations
// Generate shortcuts for custom animations
jQuery
.
each
({
jQuery
.
each
({
slideDown
:
genFx
(
"show"
,
1
),
slideDown
:
genFx
(
"show"
,
1
),
...
@@ -536,21 +557,4 @@ if ( jQuery.expr && jQuery.expr.filters ) {
...
@@ -536,21 +557,4 @@ if ( jQuery.expr && jQuery.expr.filters ) {
};
};
}
}
function
defaultDisplay
(
nodeName
)
{
if
(
!
elemdisplay
[
nodeName
]
)
{
var
elem
=
jQuery
(
"<"
+
nodeName
+
">"
).
appendTo
(
"body"
),
display
=
elem
.
css
(
"display"
);
elem
.
remove
();
if
(
display
===
"none"
||
display
===
""
)
{
display
=
"block"
;
}
elemdisplay
[
nodeName
]
=
display
;
}
return
elemdisplay
[
nodeName
];
}
})(
jQuery
);
})(
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