Use CSS3 animation animation to control the display and hiding of elements

Source: Internet
Author: User

CSS3 in animation and transition both can create animation effect, and is the background C + + execution, so efficiency than ordinary jquery JS simulation animation efficiency is much higher, so we recommend that you can use CSS to achieve the effect of using CSS.

The use of transition is relatively simple, here is not introduced, focusing on the introduction of the next animation.

Animation has a lot of CSS properties, this article through the Animation-name to control the start animation and conversion animation, the following is a animation to control the display of elements and hidden examples (only support WebKit):

<!doctype html> 

The reason is to use two animations (Slidein and Slideout), because: Slidein animation is to slide the element in, when the element style has been set to Fadein animation 100% style, even if the show style is deleted also has no effect on the element, So this is the time to use Slideout animation to slide the elements out of the line.

-webkit-animation-fill-mode:both;This style is intended to preserve the state of the animation when the animation is complete, and if you do not add this style, the animation will bounce back to its original state.

My animation uses the method to introduce here, the big God has the wood to have the better realization method or the suggestion, welcome the exchange under Bai ~

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.