Created
January 14, 2013 06:30
-
-
Save slav123/4528153 to your computer and use it in GitHub Desktop.
CSS3 transitions recognition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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