mixinmax / jquery.swatches

A jQuery plugin that turns a one-line div into a sweet color swatch
http://maxmackie.github.io/jquery.swatches/
243 stars 26 forks source link

Use CSS transitions for the hover effects #2

Open isGabe opened 11 years ago

isGabe commented 11 years ago

I say when it comes to enhancements like that, code for browsers of the present and future and let browsers of the past do without.

pkarl commented 11 years ago

Here's some cool reading about how to do this. Having Modernizr as a dep would be lame, but if you're only detecting css animation features, you could probably do it in a line.

http://www.bradshawenterprises.com/blog/2011/a-jquery-function-to-animate-using-css3-transitions-if-possible-with-the-animate-fallback/

mixinmax commented 11 years ago

Yeah this does look cool. I'll take a look at it tonight. Cheers

isGabe commented 11 years ago

I guess IE 9 doesn't support transitions, does it? So maybe the fallback is the way to go. I know Flexslider does the CSS animation with jQuery fallback, but not sure how it works. https://github.com/woothemes/flexslider