The first 2 questions are answered by the specification .
In the loop: animation-iteration-count: infinite;
And the cyclical background color includes the @keyframes rule @keyframes .
body { background: #0ff; } @-webkit-keyframes blink { 0% { background: rgba(255,0,0,0.5); } 50% { background: rgba(255,0,0,0); } 100% { background: rgba(255,0,0,0.5); } } @keyframes blink { 0% { background: rgba(255,0,0,0.5); } 50% { background: rgba(255,0,0,0); } 100% { background: rgba(255,0,0,0.5); } } #animate { height: 100px; width: 100px; background: rgba(255,0,0,1); } #animate { -webkit-animation-direction: normal; -webkit-animation-duration: 5s; -webkit-animation-iteration-count: infinite; -webkit-animation-name: blink; -webkit-animation-timing-function: ease; animation-direction: normal; animation-duration: 5s; animation-iteration-count: infinite; animation-name: blink; animation-timing-function: ease; }
(do not forget about the applicable vendor prefixes!)
As for browser support, I canβt tell you the specifics, but in any case, I would recommend detecting the function through modernizr and javascript reserve.
Here is an example that works in webkit and fulfills at least some of your requirements. NOTE. I do not use mac, so I was not sure about the specifics of the effect you were referring to.
David wick
source share