The display animation of jquery animation

Source: Internet
Author: User

Show animations

Take one of the following code examples:

<!doctype html>        . box{            width:200px;            height:200px;            Background-color: #ff6700;            Display:none;        }     </style>

There are three ways to show animations

Way One:

    <script type= "Text/javascript" src= "jquery.js" ></script>    <script type= "Text/javascript" >         $ (". Box"). Show ();     </script>

Explanation: Using show (), without parameters, means that the specified element is displayed directly.

In fact, the bottom of this method is through Display:block;

Way two:

<script type= "Text/javascript" src= "jquery.js" ></script><script type= "Text/javascript" >    // gradually show    in 3 seconds $ (". Box"). Show (+); </script>

Explanation: Use Show (value) to indicate that it is gradually displayed within a certain period of time.

This method is implemented by controlling the width, transparency, and display properties of the element.

Way three:

<script type= "Text/javascript" src= "jquery.js" ></script><script type= "Text/javascript" >    $ (function  () {       $ (". Box"). Show ("Slow");   }) </script>

Explanation: By using the show () parameter, the parameters can be:

(1) Slow (slow): 600ms;

(2) Normal (normal): 400ms;

(3) Fast (FAST): 200ms;

Calling show () in this way is also accomplished by the width, transparency, and display properties of the control element that is empty.

Add: After the animation is finished, another program is executed

    <script type= "Text/javascript" src= "jquery.js" ></script>    <script type= "Text/javascript" >         $ (function  () {            $ (function  () {                alert ("completion of animation")            });            })     </script>

Explanation: In this way, a function is added to show (), which executes when show () finishes executing.

This function can be added in the form one, the way two, the way three.

The display animation of jquery animation

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.