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
274d8b79
Commit
274d8b79
authored
Jul 17, 2006
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed flickering an auto in all browsers but IE.
parent
954554e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
fx.js
fx/fx.js
+16
-8
No files found.
fx/fx.js
View file @
274d8b79
...
@@ -20,7 +20,7 @@ jQuery.fn.extend({
...
@@ -20,7 +20,7 @@ jQuery.fn.extend({
},
speed
,
callback
)
:
this
.
_show
();
},
speed
,
callback
)
:
this
.
_show
();
},
},
//
We're overwriting
the old hide method
//
Overwrite
the old hide method
_hide
:
jQuery
.
fn
.
hide
,
_hide
:
jQuery
.
fn
.
hide
,
/**
/**
...
@@ -204,12 +204,12 @@ jQuery.extend({
...
@@ -204,12 +204,12 @@ jQuery.extend({
// Figure out the maximum number to run to
// Figure out the maximum number to run to
z
.
max
=
function
(){
z
.
max
=
function
(){
return
z
.
el
[
"orig"
+
prop
]
||
z
.
cur
(
);
return
parseFloat
(
jQuery
.
css
(
z
.
el
,
prop
)
);
};
};
// Get the current size
// Get the current size
z
.
cur
=
function
(){
z
.
cur
=
function
(){
return
parseFloat
(
jQuery
.
c
ss
(
z
.
el
,
prop
)
);
return
parseFloat
(
jQuery
.
c
urCSS
(
z
.
el
,
prop
)
)
||
z
.
max
(
);
};
};
// Start an animation from one number to another
// Start an animation from one number to another
...
@@ -225,9 +225,12 @@ jQuery.extend({
...
@@ -225,9 +225,12 @@ jQuery.extend({
// Simple 'show' function
// Simple 'show' function
z
.
show
=
function
(){
z
.
show
=
function
(){
y
.
display
=
"block"
;
// Remember where we started, so that we can go back to it later
z
.
el
[
"orig"
+
prop
]
=
this
.
cur
();
z
.
o
.
auto
=
true
;
z
.
o
.
auto
=
true
;
z
.
custom
(
0
,
z
.
max
());
z
.
custom
(
0
,
z
.
max
());
y
.
display
=
"block"
;
};
};
// Simple 'hide' function
// Simple 'hide' function
...
@@ -239,7 +242,7 @@ jQuery.extend({
...
@@ -239,7 +242,7 @@ jQuery.extend({
z
.
custom
(
z
.
cur
(),
0
);
z
.
custom
(
z
.
cur
(),
0
);
};
};
// IE has trouble with opacity if it does
n'
t have layout
// IE has trouble with opacity if it does
no
t have layout
if
(
jQuery
.
browser
.
msie
&&
!
z
.
el
.
currentStyle
.
hasLayout
)
if
(
jQuery
.
browser
.
msie
&&
!
z
.
el
.
currentStyle
.
hasLayout
)
y
.
zoom
=
1
;
y
.
zoom
=
1
;
...
@@ -263,20 +266,25 @@ jQuery.extend({
...
@@ -263,20 +266,25 @@ jQuery.extend({
// 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,
// If the element was shown, and not using a custom number,
// set its height and/or width to auto
// set its height and/or width to auto
if
(
(
prop
==
"height"
||
prop
==
"width"
)
&&
z
.
o
.
auto
)
if
(
(
prop
==
"height"
||
prop
==
"width"
)
&&
z
.
o
.
auto
)
jQuery
.
setAuto
(
z
.
el
,
prop
);
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
// Yes, this is a weird place for this, but it needs to be executed
// only once per cluster of effects.
// only once per cluster of effects.
// If the element is, effectively, hidden - hide it
// If the element is, effectively, hidden - hide it
if
(
y
.
height
==
"0px"
||
y
.
width
==
"0px"
)
if
(
y
.
height
==
"0px"
||
y
.
width
==
"0px"
)
{
y
.
display
=
"none"
;
y
.
display
=
"none"
;
if
(
z
.
el
.
origheight
)
y
.
height
=
z
.
el
.
origheight
;
if
(
z
.
el
.
origwidth
)
y
.
width
=
z
.
el
.
origwidth
;
}
// Execute the complete function
// Execute the complete function
z
.
o
.
complete
.
apply
(
z
.
el
);
z
.
o
.
complete
.
apply
(
z
.
el
);
...
...
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