![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
animation-frame
Advanced tools
If you are inside of a commonjs/amd module:
var AnimationFrame = require('animation-frame');
Otherwise its defined on window:
var AnimationFrame = window.AnimationFrame;
AnimationFrame.shim(options)
It will replace native implementation if it does exist but still will use it if possible.
So you can use window.requestAnimationFrame
and window.cancelAnimationFrame
after this safely. Optionally you can pass the frame rate.
AnimationFrame.shim(options);
There are devices with different refresh rate than 60 out of there. You can define a custom value, for the shim implementation. Native implementation should do it for you. Do it before requesting frames, because after that the frame length is cached.
AnimationFrame.FRAME_RATE = 30;
new AnimationFrame(options)
Options can be an object or a number, number is the custom frame rate.
Options:
useNative
use the native animation frame if possible, defaults to trueframeRate
pass a custom frame rate // Using default frame rate
var animationFrame = new AnimationFrame();
// Using custom frame rate.
var animationFrame = new AnimationFrame(20);
// Avoid using native RAF:
var animationFrame = new AnimationFrame({useNative: false});
animationFrame.request(fn)
var frameId = animationFrame.request(function(time) {
// Your animation here.
});
animationFrame.cancel(frameId)
var animationFrame = new AnimationFrame();
animationFrame.cancel(frameId);
http://paulirish.com/2011/requestanimationframe-for-smart-animating
http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
https://gist.github.com/paulirish/1579671
https://gist.github.com/jonasfj/4438815
https://gist.github.com/KrofDrakula/5318048
MIT
FAQs
An even better requestAnimationFrame
The npm package animation-frame receives a total of 2,734 weekly downloads. As such, animation-frame popularity was classified as popular.
We found that animation-frame demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.