Skip to content

Instantly share code, notes, and snippets.

@genoma
Last active December 24, 2015 21:59
Show Gist options
  • Save genoma/6869112 to your computer and use it in GitHub Desktop.
Save genoma/6869112 to your computer and use it in GitHub Desktop.
Check browser support for CSS3 transitions
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