Last active
December 24, 2015 21:59
-
-
Save genoma/6869112 to your computer and use it in GitHub Desktop.
Check browser support for CSS3 transitions
This file contains 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
supportsTransitions = -> | |
docBody = document.body or document.documentElement | |
styles = docBody.style | |
prop = "transition" | |
return true if typeof styles[prop] is "string" | |
# Tests for vendor specific prop | |
vendor = ["Moz", "Webkit", "Khtml", "O", "ms"] | |
prop = prop.charAt(0).toUpperCase() + prop.substr(1) | |
i = undefined | |
i = 0 | |
while i < vendor.length | |
return true if typeof styles[vendor[i] + prop] is "string" | |
i++ | |
false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment