css3 Animation:
@-webkit-keyframes twinkling{ /*Transparency from 0 to 1*/
0%{
opacity:0; /*Transparency is 0*/
}
100%{
opacity :1; /*Transparency is 1*/
}
}
Jquery:
$(element).css({"-webkit-animation":"twinkling 1s infinite ease-in-out"}); //Add flickering animation to the object element
can also be added to the css style as follows:
#element{
-webkit-animation: twinkling 1s infinite ease-in-out;
}
Note: The animation name is twinkling, the time is 1s, the number of animations is unlimited, and the animation effect is ease. -in-out
Simple! In fact, using css3 to create animation effects is much more convenient and simpler than using flash and javascript! I hope that browsers will soon support css3 Animation. Currently, browsers with webkit core support (safrai, chrome)