
@keyframes epilepsy { from { background: red; color:blue; } to { background: blue; color:red; } } .element { animation-duration: 0.1s; animation-name: epilepsy; animation-iteration-count: infinite; animation-direction: alternate; }
Note : I did not add provider prefixes.
Update

I was a bit zealous and turned on jQuery and modernizr fallback . Note that background color transition is not supported in jQuery aimate by default; jQuery color plugin required
$(document).ready(function() { // Using Modernizr to test if CSS transition is supported or not if(!Modernizr.csstransitions){ setInterval(function() { // Go really crazy and do the amazing voodoo using JavaScript $('.default').animate({ backgroundColor: 'red', color: 'blue' }, 100).animate({ backgroundColor: 'blue', color: 'red' }, 100); }, 100); }); });
source share