Use the animation function animate of jQuery to implement the pea emission effect.

Source: Internet
Author: User
This article mainly describes the basic usage of jQuery's animate function, and uses the animation function animate to realize the effect of the pea emission. It is very helpful for learning the animation function and can be used as a reference if necessary. Peas, lawns, and bullets are all ready-made images,

1. Is jQuery a library or framework?

JQuery is now the most popular js class library, rather than the framework.

Previously, I saw someone say this in zhihu:

You call library. Framework callyou.

I think that, literally, you can use a class library without constraints, but you need to use a framework under various constraints.

I personally think that the js library refers to an API that interacts directly with document elements. You can directly reference the library to serve you. The framework is biased towards the architecture level. If you want to use the framework, you must follow its rules. For example, angular. js provides methods and limits the dom document structure.

Taking the three major Java frameworks as an example, if you want to use Spring, you have to follow its steps, just like a house, reinforced concrete has been completed, you only need to enter the decoration and it will be OK. The library is a bit similar to the charm of StringUtils. In addition to the interfaces exposed by it, you don't need to worry about anything else. Just call it directly.

2. the animate function of jQuery

The animate () function is used to execute a css-based Custom Animation.

Basic usage:

$('#id').animate(css,time,callback);

Css: List of final styles you need to implement

Time: the time of transition.

Callback: callback function

The role of the animate function is to achieve the transition effect of some css styles.

3. Introduce jQuery

For example, I have a p box.

   
   
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.