Css special effects-a flash on the image, css special effects flash across
In Baidu music http://music.baidu.com/see such an image effect, when the mouse moves up, there will be a flash on the picture across, the effect is very cool. So we can implement this effect again:
The general idea is to design a transparent layer I. skewx undergoes a negative 25 degree deformation on the X axis. The background color uses the linear gradient linear-gradient of CSS3, and then hover, set the animation time to 0.5s.
At the same time, use cursor: pointer on the I layer. If this is not set, you must wait for the transparent layer animation to see the pointer.
Open fireBUG debugging to make it clearer!
- <! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <Html xmlns = "http://www.w3.org/1999/xhtml">
- <Head>
- <Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
- <Title> flashing images </title>
- <Style>
- . Overimg {
- Position: relative;
- Display: block;
- /* Overflow: hidden ;*/
- Box-shadow: 0 0 10px # FFF;
- }
- . Light {
- Cursor: pointer;
- Position: absolute;
- Left:-180px;
- Top: 0;
- Width: 180px;
- Height: 90px;
- Background-image:-moz-linear-gradient (0deg, rgba (255,255,255, 0), rgba (255,255,255, 0.5), rgba (255,255,255, 0 ));
- Background-image:-webkit-linear-gradient (0deg, rgba (255,255,255, 0), rgba (255,255,255, 0.5), rgba (255,255,255, 0 ));
- Transform: skewx (-25deg );
- -O-transform: skewx (-25deg );
- -Moz-transform: skewx (-25deg );
- -Webkit-transform: skewx (-25deg );
- }
- . Overimg: hover. light {
- Left: 180px;
- -Moz-transition: 0.5 s;
- -O-transition: 0.5 s;
- -Webkit-transition: 0.5 s;
- Transition: 0.5 s;
- }
- </Style>
- </Head>
- <Body>
- <P class = "overimg">
- <A> </a>
- <I class = "light"> </I>
- </P>
- </Body>
- </Html