Skip to content

Instantly share code, notes, and snippets.

@VoQn
Created April 22, 2011 04:18
Show Gist options
  • Save VoQn/936007 to your computer and use it in GitHub Desktop.
Save VoQn/936007 to your computer and use it in GitHub Desktop.
Generate CSS3 Transition Properties
animateCSS = (css, duration = '1s', timing_function = 'linear', delay = 0) ->
obj = {}
if css?
animate = ''
for property, value of css
obj[property] = value
animate += ', ' unless animate is ''
animate += "#{property} #{duration} #{timing_function} #{delay}"
if animate isnt ''
for browser in ['', '-o-', '-moz-', '-webkit-']
obj["#{browser}transition"] = animate
return obj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment