Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
jquery.requestanimationframe
Advanced tools
Replaces the standard jQuery timer loop with requestAnimationFrame where supported. Requires jQuery >=1.8
Replaces the standard jQuery timer loop with requestAnimationFrame
where supported.
NOTE: jQuery 3.0.0 & newer uses requestAnimationFrame
natively if it's available in the browser. This plugin is only needed for older versions of jQuery. If it detects jQuery 3.0 or newer it warns and does nothing.
Requires jQuery 1.8+
requestAnimationFrame
?requestAnimationFrame
is a W3C spec (at Candidate Recommendation level) that attempts to improve our animation performace by better syncing up with the frame rate of the browser. For more information, read this article on Jank Busting
To quote part of the Jank Busting article:
Animations in background tabs get paused, conserving system resources and battery life.
If the system can't handle rendering at the screen's refresh rate, it can throttle animations and produce the callback less frequently (say, 30 times a second on a 60Hz screen). While this drops framerate in half, it keeps the animation consistent -- and as stated above, our eyes are much more attuned to variance than framerate. A steady 30Hz looks better than 60Hz that misses a few frames a second.
Download the production version or the development version of version 0.1.2.
In your web page:
<script src="jquery.js"></script>
<script src="jquery.requestanimationframe.min.js"></script>
There isn't anything you need to do other than include the jquery.requestanimationframe.js
file to use requestAnimationFrame
.
You should however beware of the first point above: Animations in background tabs get paused.
This means if you are using a setInterval
or setTimeout
to queue up new animations, when the user returns to the backgrounded page, jQuery will finally see an animation finish, and then start playing everything queued. There is more information about potential workarounds in jQuery Core Bug #9381
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.
Also, please don't edit files in the "dist" subdirectory as they are generated via grunt. You'll find source code in the "src" subdirectory!
o
prefix - opera only ships with unprefixed rAFms
prefixCopyright (c) 2012 Corey Frang Licensed under the MIT license.
FAQs
Replaces the standard jQuery timer loop with requestAnimationFrame where supported. Requires jQuery >=1.8
The npm package jquery.requestanimationframe receives a total of 14 weekly downloads. As such, jquery.requestanimationframe popularity was classified as not popular.
We found that jquery.requestanimationframe demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.