I have a problem with taking this off of chrome. There is a piece of JavaScript code that will only work if I use it on chrome or safari. Instead of loading the animation, it will just show a black screen and will not load anything. However, I have a program called HTML editor that can run JavaScript outside of those Browsers. I have a suspicion feeling it has something to do about the vendors. Is there any way I can change or delete any coding that can help it run off of the program? This is originally from an HTML5 website. This is the code below.
}
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame'];
}
if (!window.requestAnimationFrame)
window.requestAnimationFrame = function(callback, element) {
var currTime = new Date().getTime();
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
var id = window.setTimeout(function() { callback(currTime + timeToCall); },
timeToCall);
lastTime = currTime + timeToCall;
return id;
};
if (!window.cancelAnimationFrame)
window.cancelAnimationFrame = function(id) {
clearTimeout(id);
};