For HTML5 games,with canvas animation for mobile devices.
I\'m facing some performance issues which differ the speed between each device and the others.
window.requestAnimFrame = function(){
return (
window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function(/* function */ draw1){
window.setTimeout(draw1, 1000 / 60);
}
);
}();
window.requestAnimFrame(draw);
})();
use this function for all cases