Home > Web Front-end > JS Tutorial > Simple flashing effect of css3 elements (html5 jquery)_javascript skills

Simple flashing effect of css3 elements (html5 jquery)_javascript skills

WBOY
Release: 2016-05-16 17:06:32
Original
1131 people have browsed it

css3 Animation:

Copy code The code is as follows:

@-webkit-keyframes twinkling{ /*Transparency from 0 to 1*/
0%{
opacity:0; /*Transparency is 0*/
}
100%{
opacity :1; /*Transparency is 1*/

}
}


Jquery:
Copy code The code is as follows:

$(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:
Copy the code The code is 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)

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template