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
f7ccec1b
Commit
f7ccec1b
authored
Jan 31, 2011
by
louisremi
Committed by
timmywil
Apr 04, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use requestAnimationFrame instead of setInterval for animations, when available.
parent
2ed81b44
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
effects.js
src/effects.js
+5
-1
support.js
src/support.js
+8
-0
No files found.
src/effects.js
View file @
f7ccec1b
...
@@ -363,6 +363,8 @@ jQuery.fx.prototype = {
...
@@ -363,6 +363,8 @@ jQuery.fx.prototype = {
t
.
elem
=
this
.
elem
;
t
.
elem
=
this
.
elem
;
if
(
t
()
&&
jQuery
.
timers
.
push
(
t
)
&&
!
timerId
)
{
if
(
t
()
&&
jQuery
.
timers
.
push
(
t
)
&&
!
timerId
)
{
jQuery
.
support
.
requestAnimationFrame
?
window
[
jQuery
.
support
.
requestAnimationFrame
](
fx
.
tick
):
timerId
=
setInterval
(
fx
.
tick
,
fx
.
interval
);
timerId
=
setInterval
(
fx
.
tick
,
fx
.
interval
);
}
}
},
},
...
@@ -468,6 +470,8 @@ jQuery.extend( jQuery.fx, {
...
@@ -468,6 +470,8 @@ jQuery.extend( jQuery.fx, {
if
(
!
timers
.
length
)
{
if
(
!
timers
.
length
)
{
jQuery
.
fx
.
stop
();
jQuery
.
fx
.
stop
();
}
else
if
(
jQuery
.
support
.
requestAnimationFrame
)
{
window
[
jQuery
.
support
.
requestAnimationFrame
](
this
);
}
}
},
},
...
...
src/support.js
View file @
f7ccec1b
...
@@ -58,6 +58,14 @@
...
@@ -58,6 +58,14 @@
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
optSelected
:
opt
.
selected
,
optSelected
:
opt
.
selected
,
// Verify requestAnimationFrame mechanism existence
// use the prefixed name as the value
requestAnimationFrame
:
mozRequestAnimationFrame
?
'mozRequestAnimationFrame'
:
webkitRequestAnimationFrame
?
'webkitRequestAnimationFrame'
:
false
,
// Will be defined later
// Will be defined later
deleteExpando
:
true
,
deleteExpando
:
true
,
optDisabled
:
false
,
optDisabled
:
false
,
...
...
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