CSS 3 transition Effect of jquery Fadein, FadeOut

Source: Internet
Author: User

. div {  Visibility:hidden;  opacity:0;  transition:visibility 0s linear 0.5s,opacity 0.5s linear;}. div:hover {  visibility:visible;  opacity:0.5;  transition-delay:0s;}

In jquery, simply call $ (' xx '). FadeIn (), you can complete the effect on element, but I want to use CSS3 to complete the can? Of course!

We will use the above code to finish the fade, but we don't need to be in such trouble now.

div {  Visibility:hidden;  opacity:0;  Transition:all 0.5s Linear;} div:hover {  visibility:visible;  opacity:0.5; }

This is much simpler, do not need to know so much, in the CSS to explain in the hover, give the effect, there is transition to declare the transition can be

Details and principles

In the modern browser, just give Div a transition to be able to, when hover, Div:hover also has the transition effect.

If you're asking for a 2-second stop at hover, you can just finish the effect when you leave, which also

div {  Visibility:hidden;  opacity:0;  Transition:all 0.5s Linear;} div:hover {  visibility:visible;  Transition:all 0.5s linear 2s; }

When moving points on element, the CSS of div hover will be used directly, and leaving will use the original CSS. If hover does not have a transition CSS, it will use the DIV's transition css.

CSS 3 transition Effect of jquery Fadein, FadeOut

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.