var div = document.getElementsByTagName('div');
//div[3].innerHTML = mozCancelAnimationFrame || '';
/**
* **DISCLAIMER** not yet tested.
* This timing functioin will return the native or prefixexd requestAnimationFrame or
* cancelAnimationFrame function for all modern and legacy browsers that
* natively support the timing functions. "ms" & "o" are not required.
* @author Julien Etienne
* @license MIT
* @param {String} type 'request' | 'cancel'
* @return {Function} Timing function.
*/
function RequestFrame(type) {
// Vendor prefixes disassembled
var vendors = ['moz', 'webkit'],
aF = 'AnimationFrame',
vendorCancel,
rAF, cAF, rqAF = 'Request' + aF,
lastTime = 0;
/**
* hasIOS6RequestAnimationFrameBug.
* @See {@Link https://gist.github.com/julienetie/86ac394ec41f1271ff0a} - Commentary.
* @Copyright 2015 - Julien Etienne.
* @License: MIT.
*/
function hasIOS6RequestAnimationFrameBug() {
var hasMobileDeviceWidth = screen.width <= 768 ? true : false,
requiresWebkitRequestAnimationFrame = !((window.webkitRequestAnimationFrame && window.requestAnimationFrame)),
hasNoNavigationTiming = window.performance ? false : true;
if (requiresWebkitRequestAnimationFrame && hasMobileDeviceWidth && hasNoNavigationTiming) {
if (window.webkitRequestAnimationFrame || window.requestAnimationFrame) {
console.warn('This device may contain the iOS v6x webkitRequestAnimationFrame timing bug. For timing, please use an alternative such as the "setTimeout()" or "setInterval()" API');
return true;
} else {
console.info('hasIOS6RequestAnimationFrameBug is not applicable for this device');
return false;
}
} else {
...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.