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
29a05914
Commit
29a05914
authored
Jul 24, 2006
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IE flicker has been killed and setAuto now works in Firefox and IE.
parent
a03b3fd3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
25 deletions
+36
-25
fx.js
fx/fx.js
+33
-22
jquery.js
jquery/jquery.js
+3
-3
No files found.
fx/fx.js
View file @
29a05914
...
@@ -121,12 +121,20 @@ jQuery.fn.extend({
...
@@ -121,12 +121,20 @@ jQuery.fn.extend({
jQuery
.
extend
({
jQuery
.
extend
({
setAuto
:
function
(
e
,
p
)
{
setAuto
:
function
(
e
,
p
)
{
// Remember the original height
var
a
=
e
.
style
[
p
];
var
a
=
e
.
style
[
p
];
var
o
=
jQuery
.
css
(
e
,
p
);
e
.
style
[
p
]
=
"auto"
;
// Figure out the size of the height right now
var
n
=
jQuery
.
css
(
e
,
p
);
var
o
=
jQuery
.
curCSS
(
e
,
p
,
1
);
if
(
o
!=
n
)
e
.
style
[
p
]
=
a
;
// Set the height to auto
e
.
style
[
p
]
=
e
.
currentStyle
?
""
:
"auto"
;
// See what the size of "auto" is
var
n
=
jQuery
.
curCSS
(
e
,
p
,
1
);
// Revert back to the original size
if
(
o
!=
n
&&
n
!=
"auto"
)
e
.
style
[
p
]
=
a
;
},
},
speed
:
function
(
s
,
o
,
i
)
{
speed
:
function
(
s
,
o
,
i
)
{
...
@@ -198,8 +206,10 @@ jQuery.extend({
...
@@ -198,8 +206,10 @@ jQuery.extend({
if
(
window
.
ActiveXObject
)
if
(
window
.
ActiveXObject
)
y
.
filter
=
"alpha(opacity="
+
z
.
now
*
100
+
")"
;
y
.
filter
=
"alpha(opacity="
+
z
.
now
*
100
+
")"
;
y
.
opacity
=
z
.
now
;
y
.
opacity
=
z
.
now
;
}
else
y
[
prop
]
=
z
.
now
+
"px"
;
// My hate for IE will never die
}
else
if
(
parseInt
(
z
.
now
)
)
y
[
prop
]
=
parseInt
(
z
.
now
)
+
"px"
;
};
};
// Figure out the maximum number to run to
// Figure out the maximum number to run to
...
@@ -231,7 +241,13 @@ jQuery.extend({
...
@@ -231,7 +241,13 @@ jQuery.extend({
z
.
el
.
orig
[
prop
]
=
this
.
cur
();
z
.
el
.
orig
[
prop
]
=
this
.
cur
();
if
(
!
y
[
prop
]
)
z
.
o
.
auto
=
true
;
if
(
!
y
[
prop
]
)
z
.
o
.
auto
=
true
;
z
.
custom
(
0
,
z
.
max
());
z
.
custom
(
0
,
z
.
max
());
// Stupid IE, look what you made me do
if
(
prop
!=
"opacity"
)
y
[
prop
]
=
"1px"
;
y
.
display
=
"block"
;
y
.
display
=
"block"
;
};
};
...
@@ -242,7 +258,8 @@ jQuery.extend({
...
@@ -242,7 +258,8 @@ jQuery.extend({
// Remember where we started, so that we can go back to it later
// Remember where we started, so that we can go back to it later
z
.
el
.
orig
[
prop
]
=
this
.
cur
();
z
.
el
.
orig
[
prop
]
=
this
.
cur
();
z
.
o
.
hide
=
true
;
z
.
o
.
hide
=
true
;
// Begin the animation
// Begin the animation
z
.
custom
(
z
.
cur
(),
0
);
z
.
custom
(
z
.
cur
(),
0
);
};
};
...
@@ -265,33 +282,27 @@ jQuery.extend({
...
@@ -265,33 +282,27 @@ jQuery.extend({
// Stop the timer
// Stop the timer
clearInterval
(
z
.
timer
);
clearInterval
(
z
.
timer
);
z
.
timer
=
null
;
z
.
timer
=
null
;
z
.
now
=
lastNum
;
z
.
now
=
lastNum
;
z
.
a
();
z
.
a
();
// Hide the element if the "hide" operation was done
if
(
z
.
o
.
hide
)
y
.
display
=
'none'
;
// Reset the overflow
// Reset the overflow
y
.
overflow
=
z
.
oldOverflow
;
y
.
overflow
=
z
.
oldOverflow
;
// If the element was shown, and not using a custom number,
// set its height and/or width to auto
if
(
(
prop
==
"height"
||
prop
==
"width"
)
&&
z
.
o
.
auto
)
jQuery
.
setAuto
(
z
.
el
,
prop
);
// If a callback was provided, execute it
// If a callback was provided, execute it
if
(
z
.
o
.
complete
&&
z
.
o
.
complete
.
constructor
==
Function
)
{
if
(
z
.
o
.
complete
&&
z
.
o
.
complete
.
constructor
==
Function
)
// 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
(
z
.
o
.
hide
)
y
.
display
=
"none"
;
// Execute the complete function
// Execute the complete function
z
.
o
.
complete
.
apply
(
z
.
el
);
z
.
o
.
complete
.
apply
(
z
.
el
);
}
// Reset the property, if the item has been hidden
// Reset the property, if the item has been hidden
if
(
z
.
o
.
hide
)
if
(
z
.
o
.
hide
)
y
[
prop
]
=
z
.
el
.
orig
[
prop
].
constructor
==
Number
&&
prop
!=
"opacity"
?
z
.
el
.
orig
[
prop
]
+
"px"
:
z
.
el
.
orig
[
prop
];
y
[
prop
]
=
z
.
el
.
orig
[
prop
].
constructor
==
Number
&&
prop
!=
"opacity"
?
z
.
el
.
orig
[
prop
]
+
"px"
:
z
.
el
.
orig
[
prop
];
// set its height and/or width to auto
jQuery
.
setAuto
(
z
.
el
,
prop
);
}
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
var
p
=
(
t
-
this
.
startTime
)
/
z
.
o
.
duration
;
var
p
=
(
t
-
this
.
startTime
)
/
z
.
o
.
duration
;
...
...
jquery/jquery.js
View file @
29a05914
...
@@ -62,7 +62,7 @@ function jQuery(a,c) {
...
@@ -62,7 +62,7 @@ function jQuery(a,c) {
// Watch for when an array is passed in
// Watch for when an array is passed in
this
.
get
(
a
.
constructor
==
Array
||
a
.
length
&&
a
[
0
]
!=
undefined
&&
a
[
0
].
nodeType
?
this
.
get
(
a
.
constructor
==
Array
||
a
.
length
&&
a
[
0
]
!=
undefined
&&
a
[
0
].
nodeType
?
// Assume that it
'
s an array of DOM Elements
// Assume that it
i
s an array of DOM Elements
jQuery
.
merge
(
a
,
[]
)
:
jQuery
.
merge
(
a
,
[]
)
:
// Find the matching elements and save them for later
// Find the matching elements and save them for later
...
@@ -1181,10 +1181,10 @@ jQuery.extend({
...
@@ -1181,10 +1181,10 @@ jQuery.extend({
return
jQuery
.
curCSS
(
e
,
p
);
return
jQuery
.
curCSS
(
e
,
p
);
},
},
curCSS
:
function
(
e
,
p
)
{
curCSS
:
function
(
e
,
p
,
force
)
{
var
r
;
var
r
;
if
(
e
.
style
[
p
])
if
(
!
force
&&
e
.
style
[
p
])
r
=
e
.
style
[
p
];
r
=
e
.
style
[
p
];
else
if
(
e
.
currentStyle
)
else
if
(
e
.
currentStyle
)
r
=
e
.
currentStyle
[
p
];
r
=
e
.
currentStyle
[
p
];
...
...
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