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
64557031
Commit
64557031
authored
Jan 05, 2007
by
Stefan Petre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed easing formulas and placed them as a plugin under interface
parent
887b890f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
512 additions
and
621 deletions
+512
-621
fx.js
src/fx/fx.js
+512
-621
No files found.
src/fx/fx.js
View file @
64557031
...
@@ -499,7 +499,7 @@ jQuery.extend({
...
@@ -499,7 +499,7 @@ jQuery.extend({
// 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
=
n
/
z
.
o
.
duration
;
var
p
=
n
/
z
.
o
.
duration
;
//if the easing function exists then use it else use default linear easing
//if the easing function exists then use it else use default linear easing
if
(
jQuery
.
easing
[
z
.
o
.
easing
])
if
(
jQuery
.
easing
&&
jQuery
.
easing
[
z
.
o
.
easing
])
z
.
now
=
jQuery
.
easing
[
z
.
o
.
easing
](
p
,
n
,
firstNum
,
(
lastNum
-
firstNum
),
z
.
o
.
duration
);
z
.
now
=
jQuery
.
easing
[
z
.
o
.
easing
](
p
,
n
,
firstNum
,
(
lastNum
-
firstNum
),
z
.
o
.
duration
);
else
else
z
.
now
=
((
-
Math
.
cos
(
p
*
Math
.
PI
)
/
2
)
+
0.5
)
*
(
lastNum
-
firstNum
)
+
firstNum
;
z
.
now
=
((
-
Math
.
cos
(
p
*
Math
.
PI
)
/
2
)
+
0.5
)
*
(
lastNum
-
firstNum
)
+
firstNum
;
...
@@ -509,114 +509,5 @@ jQuery.extend({
...
@@ -509,114 +509,5 @@ jQuery.extend({
}
}
};
};
},
/**
*
* @param Integer p period step in animation
* @param Integer n current time
* @param Mixed firstNum begin value
* @param Mixed delta change in
* @param Integer duration duration
*/
easing
:
{
linear
:
function
(
p
,
n
,
firstNum
,
delta
,
duration
)
{
return
((
-
Math
.
cos
(
p
*
Math
.
PI
)
/
2
)
+
0.5
)
*
delta
+
firstNum
;
},
easein
:
function
(
p
,
n
,
firstNum
,
delta
,
duration
)
{
return
delta
*
(
n
/=
duration
)
*
n
*
n
+
firstNum
;
},
easeout
:
function
(
p
,
n
,
firstNum
,
delta
,
duration
)
{
return
-
delta
*
((
n
=
n
/
duration
-
1
)
*
n
*
n
*
n
-
1
)
+
firstNum
;
},
easeboth
:
function
(
p
,
n
,
firstNum
,
delta
,
duration
)
{
if
((
n
/=
duration
/
2
)
<
1
)
return
delta
/
2
*
n
*
n
*
n
*
n
+
firstNum
;
return
-
delta
/
2
*
((
n
-=
2
)
*
n
*
n
*
n
-
2
)
+
firstNum
;
},
bounceout
:
function
(
p
,
n
,
firstNum
,
delta
,
duration
)
{
if
((
n
/=
duration
)
<
(
1
/
2.75
))
{
return
delta
*
(
7.5625
*
n
*
n
)
+
firstNum
;
}
else
if
(
n
<
(
2
/
2.75
))
{
return
delta
*
(
7.5625
*
(
n
-=
(
1.5
/
2.75
))
*
n
+
.
75
)
+
firstNum
;
}
else
if
(
n
<
(
2.5
/
2.75
))
{
return
delta
*
(
7.5625
*
(
n
-=
(
2.25
/
2.75
))
*
n
+
.
9375
)
+
firstNum
;
}
else
{
return
delta
*
(
7.5625
*
(
n
-=
(
2.625
/
2.75
))
*
n
+
.
984375
)
+
firstNum
;
}
},
bouncein
:
function
(
p
,
n
,
firstNum
,
delta
,
duration
)
{
if
(
jQuery
.
easing
.
bounceout
)
return
delta
-
jQuery
.
easing
.
bounceout
(
p
,
duration
-
n
,
0
,
delta
,
duration
)
+
firstNum
;
return
firstNum
+
delta
;
},
bounceboth
:
function
(
p
,
n
,
firstNum
,
delta
,
duration
)
{
if
(
jQuery
.
easing
.
bouncein
&&
jQuery
.
easing
.
bounceout
)
if
(
n
<
duration
/
2
)
return
jQuery
.
easing
.
bouncein
(
p
,
n
*
2
,
0
,
delta
,
duration
)
*
.
5
+
firstNum
;
return
jQuery
.
easing
.
bounceout
(
p
,
n
*
2
-
duration
,
0
,
delta
,
duration
)
*
.
5
+
delta
*
.
5
+
firstNum
;
return
firstNum
+
delta
;
},
elasticin
:
function
(
p
,
n
,
firstNum
,
delta
,
duration
)
{
var
a
,
s
;
if
(
n
==
0
)
return
firstNum
;
if
((
n
/=
duration
)
==
1
)
return
firstNum
+
delta
;
a
=
delta
*
0.3
;
p
=
duration
*
.
3
;
if
(
a
<
Math
.
abs
(
delta
))
{
a
=
delta
;
s
=
p
/
4
;
}
else
{
s
=
p
/
(
2
*
Math
.
PI
)
*
Math
.
asin
(
delta
/
a
);
}
return
-
(
a
*
Math
.
pow
(
2
,
10
*
(
n
-=
1
))
*
Math
.
sin
(
(
n
*
duration
-
s
)
*
(
2
*
Math
.
PI
)
/
p
))
+
firstNum
;
},
elasticout
:
function
(
p
,
n
,
firstNum
,
delta
,
duration
)
{
var
a
,
s
;
if
(
n
==
0
)
return
firstNum
;
if
((
n
/=
duration
/
2
)
==
2
)
return
firstNum
+
delta
;
a
=
delta
*
0.3
;
p
=
duration
*
.
3
;
if
(
a
<
Math
.
abs
(
delta
)){
a
=
delta
;
s
=
p
/
4
;
}
else
{
s
=
p
/
(
2
*
Math
.
PI
)
*
Math
.
asin
(
delta
/
a
);
}
}
return
a
*
Math
.
pow
(
2
,
-
10
*
n
)
*
Math
.
sin
(
(
n
*
duration
-
s
)
*
(
2
*
Math
.
PI
)
/
p
)
+
delta
+
firstNum
;
},
elasticboth
:
function
(
p
,
n
,
firstNum
,
delta
,
duration
)
{
var
a
,
s
;
if
(
n
==
0
)
return
firstNum
;
if
((
n
/=
duration
/
2
)
==
2
)
return
firstNum
+
delta
;
a
=
delta
*
0.3
;
p
=
duration
*
.
3
;
if
(
a
<
Math
.
abs
(
delta
)){
a
=
delta
;
s
=
p
/
4
;
}
else
{
s
=
p
/
(
2
*
Math
.
PI
)
*
Math
.
asin
(
delta
/
a
);
}
if
(
n
<
1
)
{
return
-
.
5
*
(
a
*
Math
.
pow
(
2
,
10
*
(
n
-=
1
))
*
Math
.
sin
(
(
n
*
duration
-
s
)
*
(
2
*
Math
.
PI
)
/
p
))
+
firstNum
;
}
return
a
*
Math
.
pow
(
2
,
-
10
*
(
n
-=
1
))
*
Math
.
sin
(
(
n
*
duration
-
s
)
*
(
2
*
Math
.
PI
)
/
p
)
*
.
5
+
delta
+
firstNum
;
}
}
});
});
\ No newline at end of file
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