Css3 Animation:
Copy codeThe Code is as follows:
@-Webkit-keyframes twinkling {/* transparency from 0 to 1 */
0% {
Opacity: 0;/* Transparency: 0 */
}
100% {
Opacity: 1;/* Transparency: 1 */
}
}
Jquery:
Copy codeThe Code is as follows:
((Element).css ({"-webkit-animation": "twinkling 1 s infinite transform-in-out"}); // Add a flashing animation to the object element
You can also add the following in the css style:
Copy codeThe Code is as follows:
# Element {
-Webkit-animation: twinkling 1 s infinite injection-in-out;
}
Note: The animation name is "twinkling" and the animation duration is "1 s". The animation effect is "Running-in-out ".
Easy! In fact, it is much easier to use css3 for animation effects than flash and javascript! We hope that all browsers support css3 Animation quickly. Currently, all browsers in the webkit Kernel support (safrai, chrome)