Css special effects-a flash on the image, css special effects flash across

Source: Internet
Author: User

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!

    1. <! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    2. <Html xmlns = "http://www.w3.org/1999/xhtml">
    3. <Head>
    4. <Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
    5. <Title> flashing images </title>
    6. <Style>
    7. . Overimg {
    8. Position: relative;
    9. Display: block;
    10. /* Overflow: hidden ;*/
    11. Box-shadow: 0 0 10px # FFF;
    12. }
    13. . Light {
    14. Cursor: pointer;
    15. Position: absolute;
    16. Left:-180px;
    17. Top: 0;
    18. Width: 180px;
    19. Height: 90px;
    20. Background-image:-moz-linear-gradient (0deg, rgba (255,255,255, 0), rgba (255,255,255, 0.5), rgba (255,255,255, 0 ));
    21. Background-image:-webkit-linear-gradient (0deg, rgba (255,255,255, 0), rgba (255,255,255, 0.5), rgba (255,255,255, 0 ));
    22. Transform: skewx (-25deg );
    23. -O-transform: skewx (-25deg );
    24. -Moz-transform: skewx (-25deg );
    25. -Webkit-transform: skewx (-25deg );
    26. }
    27. . Overimg: hover. light {
    28. Left: 180px;
    29. -Moz-transition: 0.5 s;
    30. -O-transition: 0.5 s;
    31. -Webkit-transition: 0.5 s;
    32. Transition: 0.5 s;
    33. }
    34. </Style>
    35. </Head>
    36. <Body>
    37. <P class = "overimg">
    38. <A> </a>
    39. <I class = "light"> </I>
    40. </P>
    41. </Body>
    42. </Html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.