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
268c82a9
Commit
268c82a9
authored
Jun 15, 2006
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FX Queueing added. Effects no longer mess up causing weird results.
parent
807c75da
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
19 deletions
+77
-19
fx.js
fx/fx.js
+76
-17
jquery.js
jquery/jquery.js
+1
-2
No files found.
fx/fx.js
View file @
268c82a9
...
@@ -3,54 +3,108 @@ $.speed = function(s,o) {
...
@@ -3,54 +3,108 @@ $.speed = function(s,o) {
o
=
o
||
{};
o
=
o
||
{};
var
ss
=
{
"crawl"
:
1200
,
"xslow"
:
850
,
"slow"
:
600
,
"medium"
:
400
,
"fast"
:
200
,
"xfast"
:
75
,
"normal"
:
400
};
var
ss
=
{
"crawl"
:
1200
,
"xslow"
:
850
,
"slow"
:
600
,
"medium"
:
400
,
"fast"
:
200
,
"xfast"
:
75
,
"normal"
:
400
};
o
.
duration
=
typeof
s
==
"number"
?
s
:
ss
[
s
]
||
400
;
o
.
duration
=
typeof
s
==
"number"
?
s
:
ss
[
s
]
||
400
;
o
.
oldComplete
=
o
.
onComplete
;
o
.
onComplete
=
function
(){
$
.
dequeue
(
this
,
'fx'
);
if
(
o
.
oldComplete
&&
o
.
oldComplete
.
constructor
==
Function
)
{
$
.
apply
(
this
,
o
.
oldComplete
);
}
};
return
o
;
return
o
;
};
};
$
.
queue
=
{};
$
.
dequeue
=
function
(
elem
,
type
){
type
=
type
||
'fx'
;
if
(
elem
.
$$queue
&&
elem
.
$$queue
[
type
]
)
{
// Remove self
elem
.
$$queue
[
type
].
shift
();
// Get next function
var
f
=
elem
.
$$queue
[
type
][
0
];
if
(
f
)
{
$
.
apply
(
elem
,
f
);
}
}
};
$
.
fn
.
queue
=
function
(
type
,
fn
){
if
(
!
fn
)
{
fn
=
type
;
type
=
'fx'
;
}
return
this
.
each
(
function
(){
if
(
!
this
.
$$queue
)
{
this
.
$$queue
=
{};
}
if
(
!
this
.
$$queue
[
type
]
)
{
this
.
$$queue
[
type
]
=
[];
}
this
.
$$queue
[
type
].
push
(
fn
);
if
(
this
.
$$queue
[
type
].
length
==
1
)
{
$
.
apply
(
this
,
fn
);
}
});
};
$
.
fn
.
_hide
=
$
.
fn
.
hide
;
$
.
fn
.
hide
=
function
(
a
,
o
)
{
$
.
fn
.
hide
=
function
(
a
,
o
)
{
o
=
$
.
speed
(
a
,
o
);
o
=
$
.
speed
(
a
,
o
);
return
a
?
this
.
each
(
function
(){
return
a
?
this
.
queue
(
function
(){
new
$
.
fx
.
FadeSize
(
this
,
o
).
hide
();
new
$
.
fx
.
FadeSize
(
this
,
o
).
hide
();
})
:
this
.
_hide
();
})
:
this
.
_hide
();
};
};
$
.
fn
.
_show
=
$
.
fn
.
show
;
$
.
fn
.
show
=
function
(
a
,
o
)
{
$
.
fn
.
show
=
function
(
a
,
o
)
{
o
=
$
.
speed
(
a
,
o
);
o
=
$
.
speed
(
a
,
o
);
return
a
?
this
.
each
(
function
(){
return
a
?
this
.
queue
(
function
(){
new
$
.
fx
.
FadeSize
(
this
,
o
).
show
();
new
$
.
fx
.
FadeSize
(
this
,
o
).
show
();
})
:
this
.
_show
();
})
:
this
.
_show
();
};
};
$
.
fn
.
slideDown
=
function
(
a
,
o
)
{
$
.
fn
.
slideDown
=
function
(
a
,
o
)
{
o
=
$
.
speed
(
a
,
o
);
o
=
$
.
speed
(
a
,
o
);
return
this
.
each
(
function
(){
return
this
.
queue
(
function
(){
new
$
.
fx
.
Resize
(
this
,
o
).
show
(
"height"
);
new
$
.
fx
.
Resize
(
this
,
o
).
show
(
"height"
);
});
});
};
};
$
.
fn
.
slideUp
=
function
(
a
,
o
)
{
$
.
fn
.
slideUp
=
function
(
a
,
o
)
{
o
=
$
.
speed
(
a
,
o
);
o
=
$
.
speed
(
a
,
o
);
return
this
.
each
(
function
(){
return
this
.
queue
(
function
(){
new
$
.
fx
.
Resize
(
this
,
o
).
hide
(
"height"
);
new
$
.
fx
.
Resize
(
this
,
o
).
hide
(
"height"
);
});
});
};
};
$
.
fn
.
fadeOut
=
function
(
a
,
o
)
{
$
.
fn
.
fadeOut
=
function
(
a
,
o
)
{
o
=
$
.
speed
(
a
,
o
);
o
=
$
.
speed
(
a
,
o
);
return
a
?
this
.
each
(
function
(){
return
a
?
this
.
queue
(
function
(){
new
$
.
fx
.
Opacity
(
this
,
o
,
1
).
hide
();
new
$
.
fx
.
Opacity
(
this
,
o
,
1
).
hide
();
})
:
this
.
_hide
();
})
:
this
.
_hide
();
};
};
$
.
fn
.
fadeIn
=
function
(
a
,
o
)
{
$
.
fn
.
fadeIn
=
function
(
a
,
o
)
{
o
=
$
.
speed
(
a
,
o
);
o
=
$
.
speed
(
a
,
o
);
return
a
?
this
.
each
(
function
(){
return
a
?
this
.
queue
(
function
(){
new
$
.
fx
.
Opacity
(
this
,
o
,
1
).
show
();
new
$
.
fx
.
Opacity
(
this
,
o
,
1
).
show
();
})
:
this
.
_show
();
})
:
this
.
_show
();
};
};
$
.
fn
.
fadeTo
=
function
(
a
,
ev
,
o
)
{
$
.
fn
.
fadeTo
=
function
(
a
,
ev
,
o
)
{
o
=
$
.
speed
(
a
,
o
);
o
=
$
.
speed
(
a
,
o
);
return
a
?
this
.
each
(
function
(){
return
a
?
this
.
queue
(
function
(){
ef
=
new
$
.
fx
.
Opacity
(
this
,
o
);
ef
=
new
$
.
fx
.
Opacity
(
this
,
o
);
ef
.
custom
(
ef
.
cur
(),
parseFloat
(
ev
));
ef
.
custom
(
ef
.
cur
(),
parseFloat
(
ev
));
ef
.
show
();
ef
.
show
();
...
@@ -172,24 +226,29 @@ $.fx = function(el,op,ty){
...
@@ -172,24 +226,29 @@ $.fx = function(el,op,ty){
clearInterval
(
z
.
timer
);
clearInterval
(
z
.
timer
);
z
.
timer
=
null
;
z
.
timer
=
null
;
z
.
now
=
lastNum
;
z
.
a
();
// Reset the overflow
// Reset the overflow
y
.
overflow
=
z
.
oldOverflow
;
y
.
overflow
=
z
.
oldOverflow
;
// If the element is, effectively, hidden - hide it
if
(
y
.
height
==
"0px"
||
y
.
width
==
"0px"
)
{
y
.
display
=
"none"
;
}
// If the element was shown, and not using a custom number,
// If the element was shown, and not using a custom number,
// set its height and width to auto
// set its height and/or width to auto
if
(
ty
!=
"opacity"
&&
z
.
o
.
auto
)
{
if
(
(
ty
==
"height"
||
ty
==
"width"
)
&&
z
.
o
.
auto
)
{
$
.
setAuto
(
z
.
el
,
'height'
);
$
.
setAuto
(
z
.
el
,
ty
);
$
.
setAuto
(
z
.
el
,
'width'
);
}
}
// If a callback was provided, execute it
// If a callback was provided, execute it
if
(
z
.
o
.
onComplete
.
constructor
==
Function
)
{
if
(
z
.
o
.
onComplete
.
constructor
==
Function
)
{
$
.
apply
(
z
.
el
,
z
.
onComplete
);
// Yes, this is a weird place for this, but it needs to be executed
// only once per cluster of effects.
// If the element is, effectively, hidden - hide it
if
(
y
.
height
==
"0px"
||
y
.
width
==
"0px"
)
{
y
.
display
=
"none"
;
}
$
.
apply
(
z
.
el
,
z
.
o
.
onComplete
);
}
}
}
else
{
}
else
{
// Figure out where in the animation we are and set the number
// Figure out where in the animation we are and set the number
...
...
jquery/jquery.js
View file @
268c82a9
...
@@ -365,7 +365,7 @@ $.getCSS = function(e,p) {
...
@@ -365,7 +365,7 @@ $.getCSS = function(e,p) {
els
.
visibility
=
'hidden'
;
els
.
visibility
=
'hidden'
;
els
.
position
=
'absolute'
;
els
.
position
=
'absolute'
;
els
.
display
=
''
;
els
.
display
=
''
;
oHeight
=
e
.
clientHeight
-
ph
||
parseInt
(
e
.
style
.
height
,
10
);
oHeight
=
e
.
clientHeight
||
parseInt
(
e
.
style
.
height
,
10
);
oWidth
=
e
.
clientWidth
||
parseInt
(
e
.
style
.
width
,
10
);
oWidth
=
e
.
clientWidth
||
parseInt
(
e
.
style
.
width
,
10
);
els
.
display
=
od
;
els
.
display
=
od
;
els
.
position
=
op
;
els
.
position
=
op
;
...
@@ -398,7 +398,6 @@ $.clean = function(a) {
...
@@ -398,7 +398,6 @@ $.clean = function(a) {
for
(
var
i
=
0
;
i
<
a
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
a
.
length
;
i
++
)
{
if
(
a
[
i
].
constructor
==
String
)
{
if
(
a
[
i
].
constructor
==
String
)
{
if
(
a
[
i
].
indexOf
(
"<tr"
)
==
0
)
{
if
(
a
[
i
].
indexOf
(
"<tr"
)
==
0
)
{
//alert("tr");
var
tr
=
true
;
var
tr
=
true
;
a
[
i
]
=
"<table>"
+
a
[
i
]
+
"</table>"
;
a
[
i
]
=
"<table>"
+
a
[
i
]
+
"</table>"
;
}
}
...
...
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