Skip to content

Instantly share code, notes, and snippets.

@slav123
Created January 14, 2013 06:30
Show Gist options
  • Save slav123/4528153 to your computer and use it in GitHub Desktop.
Save slav123/4528153 to your computer and use it in GitHub Desktop.
CSS3 transitions recognition
function supportsTransitions() {
var b = document.body || document.documentElement;
var s = b.style;
var p = 'transition';
if (typeof s[p] == 'string') {
return true;
}
// Tests for vendor specific prop
v = ['Moz', 'Webkit', 'Khtml', 'O', 'ms'],
p = p.charAt(0).toUpperCase() + p.substr(1);
for (var i = 0; i < v.length; i++) {
if (typeof s[v[i] + p] == 'string') {
return true;
}
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment